public class FileStreams
extends java.lang.Object
Constructor and Description |
---|
FileStreams() |
Modifier and Type | Method and Description |
---|---|
static TStream<java.lang.String> |
directoryWatcher(TopologyElement te,
java.lang.String directory)
Creates a stream of absolute newly created file names from watching
directory . |
static TStream<java.lang.String> |
suffixFilter(TStream<java.lang.String> fileNames,
java.lang.String... suffixes)
Filter a
Stream<String> containing file names by suffix values. |
static TStream<java.lang.String> |
textFileReader(TStream<java.lang.String> input)
Returns a Stream that reads each file named on its input stream,
outputting a tuple for each line read.
|
public static TStream<java.lang.String> directoryWatcher(TopologyElement te, java.lang.String directory)
directory
.directory
- Name of the directory to watch.directory
.public static TStream<java.lang.String> suffixFilter(TStream<java.lang.String> fileNames, java.lang.String... suffixes)
Stream<String>
containing file names by suffix values.
If a file name on fileNames
ends with a suffix in
suffixes
preceded by a dot '.'
.fileNames
- Input stream that will contain file names.suffixes
- Suffixes to filter for.suffixes
.public static TStream<java.lang.String> textFileReader(TStream<java.lang.String> input)
input
- Stream containing files to read.