public abstract class AbstractMarkerFilePresentFileListFilter<F> extends Object implements FileListFilter<F>
FileListFilter
if a corresponding marker file is also present to indicate a file transfer is complete.
Since they look at multiple files, they cannot be used for late filtering in the
streaming message source.| Constructor and Description |
|---|
AbstractMarkerFilePresentFileListFilter(FileListFilter<F> filter)
Construct an instance with a single
FileListFilter and ".complete"
will be appended to the name of a matched file when looking for the marker file. |
AbstractMarkerFilePresentFileListFilter(FileListFilter<F> filter,
java.util.function.Function<String,String> function)
Construct an instance with a single
FileListFilter and a function
that will be applied to the name of a matched file when looking for the marker
file. |
AbstractMarkerFilePresentFileListFilter(FileListFilter<F> filter,
String suffix)
Construct an instance with a single
FileListFilter and a suffix
that will will be appended to the name of a matched file when looking for the marker
file. |
AbstractMarkerFilePresentFileListFilter(Map<FileListFilter<F>,java.util.function.Function<String,String>> filtersAndFunctions)
Construct an instance with a map of
FileListFilter and functions be
applied to the name of a matched file when looking for the marker file. |
| Modifier and Type | Method and Description |
|---|---|
static java.util.function.Function<String,String> |
defaultFileNameFunction(String suffix)
The default function used to create the file name for the corresponding marker file.
|
List<F> |
filterFiles(F[] files)
Filters out files and returns the files that are left in a list, or an
empty list when a null is passed in.
|
protected abstract String |
getFilename(F file)
Return the name of the file represented by this F.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaccept, supportsSingleFileFilteringpublic AbstractMarkerFilePresentFileListFilter(FileListFilter<F> filter)
FileListFilter and ".complete"
will be appended to the name of a matched file when looking for the marker file.
i.e. if a file foo.txt is matched by the filter this filter will only pass
"foo.txt" if "foo.txt.complete" is present.filter - the file name filter.public AbstractMarkerFilePresentFileListFilter(FileListFilter<F> filter, String suffix)
FileListFilter and a suffix
that will will be appended to the name of a matched file when looking for the marker
file. i.e. if a file foo.txt is matched by the filter and the suffix is
".complete", this filter will only pass "foo.txt" if "foo.txt.complete" is present.filter - the file name filter.suffix - the replacement suffix.public AbstractMarkerFilePresentFileListFilter(FileListFilter<F> filter, java.util.function.Function<String,String> function)
FileListFilter and a function
that will be applied to the name of a matched file when looking for the marker
file. The function returns the name of the marker file to match, or null
for never match. If a file foo.txt is matched by the filter and the
function returns "foo.txt.complete", this filter will only pass "foo.txt" if
"foo.txt.complete" is present.filter - the file name filter.function - the function to create the marker file name from the file name.public AbstractMarkerFilePresentFileListFilter(Map<FileListFilter<F>,java.util.function.Function<String,String>> filtersAndFunctions)
FileListFilter and functions be
applied to the name of a matched file when looking for the marker file. i.e. if a
file foo.txt is matched by one of the filters and the corresponding
function returns "foo.txt.complete", this filter will only pass "foo.txt" if
"foo.txt.complete" is present. The function returns the name of the marker file to
match, or null for never match. Due to type erasure, we cannot provide a
constructor taking Map<Filter, suffix. For convenience, you can use
defaultFileNameFunction(String) to use the default function used by the
AbstractMarkerFilePresentFileListFilter(FileListFilter, String)
constructor.filtersAndFunctions - the filters and functions.public static java.util.function.Function<String,String> defaultFileNameFunction(String suffix)
suffix - the suffix to append.public List<F> filterFiles(F[] files)
FileListFilterfilterFiles in interface FileListFilter<F>files - The files.