Module id.xfunction

Class FilePredicates

Object
FilePredicates

public class FilePredicates extends Object
File predicates
  • Constructor Details

    • FilePredicates

      public FilePredicates()
  • Method Details

    • isContentEquals

      public static Predicate<Path> isContentEquals(Path target)
      Return file predicate which checks if content of a given file equals content of target file.
    • anyExtensionOf

      public static Predicate<Path> anyExtensionOf(String... targetExtensions)
      Return file predicate which checks if a given file extension is any from the list of target extensions
    • match

      public static Predicate<Path> match(String regexp)
      Return file predicate which checks if a given file name matches regular expression.

      To match only image files following regexp can be used ".*\\.(png|jpg)".