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 copying the content of the source text file to the destination text file.filter(BiConsumer<InputStream, OutputStream> filter) Specifies a function for copying the content of the source file to the destination file.static FileTreeBuilder.SourceCreates a new source specification.Specifies a function for renaming source files.replaceAll(String regex, String replacement) InvokeString.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 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 copying the content of the source file to the destination 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 copying the content of the source text file to the destination text 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
InvokeString.replaceAll(String, String)on each line of the file.- Parameters:
regex- the regexreplacement- the replacement- Returns:
- the source
-