1 10 11 package org.mule.providers.file.filters; 12 13 import java.io.File ; 14 import java.io.FilenameFilter ; 15 16 import org.mule.providers.file.FileConnector; 17 import org.mule.routing.filters.WildcardFilter; 18 import org.mule.umo.UMOMessage; 19 20 24 public class FilenameWildcardFilter extends WildcardFilter implements FilenameFilter 25 { 26 27 public FilenameWildcardFilter() 28 { 29 super(); 30 } 31 32 public FilenameWildcardFilter(String pattern) 33 { 34 super(pattern); 35 } 36 37 46 public boolean accept(File dir, String name) 47 { 48 if (name == null) 49 { 50 logger.warn("The filename and/or directory was null"); 51 return false; 52 } 53 else 54 { 55 return accept(name); 56 } 57 } 58 59 public boolean accept(UMOMessage message) 60 { 61 return accept(message.getProperty(FileConnector.PROPERTY_ORIGINAL_FILENAME)); 62 } 63 64 } 65 | Popular Tags |