Class UnsupportedFilesCopyVisitor.Builder

  • Enclosing class:
    UnsupportedFilesCopyVisitor

    public static class UnsupportedFilesCopyVisitor.Builder
    extends Object
    A builder for creating file copy visitor instances.

    Example to copy visitor what convert all xml to '\n' line feeds and escape all files with "trash" word in path:

       
    
       static final Predicate<Path> xmlFilePredicate =
          UnsupportedFilesCopyVisitor.FileExtensionPredicateBuilder.build(".xml");
       static final UnsupportedFilesCopyVisitor VISITOR =
           new UnsupportedFilesCopyVisitor.Builder(sourcePath, targetPath)
               .putModifier(xmlFilePredicate, ConvertOption.TO_LF)
               .addEscaper(p -> p.toString().contains("trash"))
               .build();

    Builder instances can be reused - it is safe to call build() multiple times to build multiple copy visitors in series.