Class FileTreeBuilder.Source
java.lang.Object
org.jdrupes.builder.core.FileTreeBuilder.Source
- Enclosing class:
FileTreeBuilder
Describes a source that contributes files to the generated
tree.
-
Method Summary
Modifier and TypeMethodDescriptionfilter(BiConsumer<BufferedReader, PrintStream> filter, Charset charset) Specifies a function for generating the content of the destination file from the source file.filter(BiConsumer<InputStream, OutputStream> filter) Specifies a function for generating the content of the destination file from the source file.static FileTreeBuilder.SourceCreates a new source specification.Specifies a function for renaming source files.replaceAll(String regex, String replacement) Sets a filter function that invokesString.replaceAll(String, String)on each line of the file.
-
Method Details
-
of
Creates a new source specification.- Parameters:
tree- the source file tree- Returns:
- the source
-
rename
Specifies a function for renaming source files. The method receives the file's path relative to the source tree's root. It must return the file's path relative to the destination set withFileTreeBuilder.into(Path).- Parameters:
renamer- the function for renaming- Returns:
- the source
-
filter
Specifies a function for generating the content of the destination file from the source file. If set, this function is invoked for each file instead of simply copying the file content.- Parameters:
filter- the copy function- Returns:
- the source
-
filter
public FileTreeBuilder.Source filter(BiConsumer<BufferedReader, PrintStream> filter, Charset charset) Specifies a function for generating the content of the destination file from the source file. If set, this function is invoked for each file instead of simply copying the file content.- Parameters:
filter- the copy functioncharset- the charset- Returns:
- the source
-
replaceAll
Sets a filter function that invokesString.replaceAll(String, String)on each line of the file.- Parameters:
regex- the regexreplacement- the replacement- Returns:
- the source
-