Class AbstractRecentFileListFilter<F>
java.lang.Object
org.springframework.integration.file.filters.AbstractRecentFileListFilter<F>
- Type Parameters:
F- The type that will be filtered.
- All Implemented Interfaces:
FileListFilter<F>
- Direct Known Subclasses:
RecentFileListFilter
The
FileListFilter to accept only files which are recent according to provided age:
the lastModified of the file is more than the age in comparison with the current time.
In other words, accept those files which are not old enough yet.- Since:
- 6.5
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstruct an instance with default age as 1 day. -
Method Summary
Modifier and TypeMethodDescriptionbooleanFilter a single file; only called externally ifFileListFilter.supportsSingleFileFiltering()returns true.protected booleanfileIsAged(F file, Instant now) 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 InstantgetLastModified(F remoteFile) booleanIndicates that this filter supports filtering a single file.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.integration.file.filters.FileListFilter
isForRecursion
-
Field Details
-
ONE_SECOND
protected static final long ONE_SECOND- See Also:
-
-
Constructor Details
-
AbstractRecentFileListFilter
public AbstractRecentFileListFilter()Construct an instance with default age as 1 day. -
AbstractRecentFileListFilter
-
-
Method Details
-
supportsSingleFileFiltering
public boolean supportsSingleFileFiltering()Description copied from interface:FileListFilterIndicates that this filter supports filtering a single file. Filters that return true must overrideFileListFilter.accept(Object). Default false.- Specified by:
supportsSingleFileFilteringin interfaceFileListFilter<F>- Returns:
- true to allow external calls to
FileListFilter.accept(Object). - See Also:
-
filterFiles
Description copied from interface:FileListFilterFilters out files and returns the files that are left in a list, or an empty list when a null is passed in.- Specified by:
filterFilesin interfaceFileListFilter<F>- Parameters:
files- The files.- Returns:
- The filtered files.
-
accept
Description copied from interface:FileListFilterFilter a single file; only called externally ifFileListFilter.supportsSingleFileFiltering()returns true.- Specified by:
acceptin interfaceFileListFilter<F>- Parameters:
file- the file.- Returns:
- true if the file passes the filter, false to filter.
- See Also:
-
fileIsAged
-
getLastModified
-