Creates a source that enumerates files within a directory, the file itself, and returns a Pipeline that produces a Map object with keys file and stream with types java.io.File and java.io.InputStream respectively. It enumerates only Files (i.e. File.isFile() == true). By default it recursively visits all subdirectories FileSystemSource.recursive. You can include an optional filter to match files FileSystemSource.filter.
Constructor and description |
---|
FileSystemSource
(java.lang.Iterable<java.io.File> files) |
Type Params | Return Type | Name and description |
---|---|---|
|
void |
doStart(Pipeline pipeline) |
|
static FileSystemSource |
files(java.io.File... directories) Pass any number of files to this method and this source will visit each file. |
|
static FileSystemSource |
files(java.lang.Iterable<java.io.File> directories) Pass an Iterable of files to this method and this source will visit each file. |
|
FileSystemSource |
filter(java.util.regex.Pattern filenameFilter) Add a filename filter using a regular expression to match filenames against. |
|
void |
process(java.io.File file, Pipeline pipeline) |
|
FileSystemSource |
recursive(boolean r) Configures this source to be visit directories recursively or not. |
Pass any number of files to this method and this source will visit each file.
directories
- 1 or more java.io.File objects to visitPass an Iterable of files to this method and this source will visit each file.
directories
- An Iterable of java.io.File objects to visitAdd a filename filter using a regular expression to match filenames against. Anything that matches the given filternameFilter will be passed onto the Pipeline.
filenameFilter
- Regular expression used to match the file.Configures this source to be visit directories recursively or not.
r
- true if you want to visit all directories recursively or
false if only the direct childrenGroovy Documentation