}
protected boolean matchFilter(Folder folder, String fileName) {
// return value
Perl5Matcher p5m = new Perl5Matcher();
Perl5Compiler p5c = new Perl5Compiler();
boolean match = false;
try {
// Obtain the filters
String filesMasks = folder.getFilesMasks();
filesMasks = (filesMasks != null ? filesMasks.trim() : filesMasks);
if (UtilMethods.isSet(filesMasks)) {
String[] filesMasksArray = filesMasks.split(",");
int length = filesMasksArray.length;
// Try to match de filters
for (int i = 0; i < length; i++) {
String regex = filesMasksArray[i];
regex = regex.replace(".", "\\.");
regex = regex.replace("*", ".*");
regex = "^" + regex.trim() + "$";
Pattern pattern = p5c.compile(regex, Perl5Compiler.CASE_INSENSITIVE_MASK);
match = match || p5m.matches(fileName, pattern);
if (match) {
break;
}
}