/**
  * Checks to see if the filename matches one of the wildcards.
  *
  * @param dir the file directory (ignored)
  * @param name the filename
  * @return true if the filename matches one of the wildcards
  */
 @Override
 public boolean accept(File dir, String name) {
   for (String wildcard : wildcards) {
     if (FilenameUtils.wildcardMatch(name, wildcard, caseSensitivity)) {
       return true;
     }
   }
   return false;
 }
 /**
  * Checks if we have a match against a wildcard matcher.
  *
  * @param value the value
  * @param wildcareMatcher the wildcard matcher
  * @return {@code true} if and only if the value matches the wildcard matcher.
  */
 static boolean isMatch(@NonNull String value, @NonNull String wildcareMatcher) {
   return FilenameUtils.wildcardMatch(value, wildcareMatcher, IOCase.SENSITIVE);
 }
Ejemplo n.º 3
0
 @Override
 public boolean accept(File file) {
   return !file.getName().endsWith(".xfer")
       && FilenameUtils.wildcardMatch(file.getName(), pattern, IOCase.INSENSITIVE)
       && FileUtils.isFileOlder(file, System.currentTimeMillis() - fileage);
 }
Ejemplo n.º 4
0
 /**
  * true if the filename is well formed, i.e. has an extension
  *
  * @param filename
  * @return
  */
 private boolean isWellFormedFileName(String filename) {
   return FilenameUtils.wildcardMatch(filename, "*.???")
       || FilenameUtils.wildcardMatch(filename, "*.??")
       || FilenameUtils.wildcardMatch(filename, "*.?");
 }