Class LastModifiedFileListFilter
java.lang.Object
org.springframework.integration.file.filters.AbstractLastModifiedFileListFilter<File>
org.springframework.integration.file.filters.LastModifiedFileListFilter
- All Implemented Interfaces:
DiscardAwareFileListFilter<File>
,FileListFilter<File>
The
FileListFilter
implementation to filter those files which
File.lastModified()
is less than the age in comparison
with the current time.
The resolution is done in seconds.
When discardCallback AbstractLastModifiedFileListFilter.addDiscardCallback(Consumer)
is provided, it called for all the
rejected files.
- Since:
- 4.2
- Author:
- Gary Russell, Artem Bilan, Adama Sorho
-
Field Summary
Fields inherited from class org.springframework.integration.file.filters.AbstractLastModifiedFileListFilter
ONE_SECOND
-
Constructor Summary
ConstructorDescriptionLastModifiedFileListFilter
(long age) Construct aLastModifiedFileListFilter
instance with provided age. -
Method Summary
Modifier and TypeMethodDescriptionlong
getAge()
Deprecated, for removal: This API element is subject to removal in a future version.protected Instant
getLastModified
(File file) void
Deprecated, for removal: This API element is subject to removal in a future version.since 6.2 in favor ofAbstractLastModifiedFileListFilter.setAge(Duration)
Methods inherited from class org.springframework.integration.file.filters.AbstractLastModifiedFileListFilter
accept, addDiscardCallback, filterFiles, getAgeDuration, setAge, setAge, supportsSingleFileFiltering
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.integration.file.filters.FileListFilter
isForRecursion
-
Constructor Details
-
LastModifiedFileListFilter
public LastModifiedFileListFilter() -
LastModifiedFileListFilter
public LastModifiedFileListFilter(long age) Construct aLastModifiedFileListFilter
instance with provided age. Defaults to 60 seconds.- Parameters:
age
- the age in seconds.- Since:
- 5.0
-
-
Method Details
-
setAge
Deprecated, for removal: This API element is subject to removal in a future version.since 6.2 in favor ofAbstractLastModifiedFileListFilter.setAge(Duration)
Set the age that files have to be before being passed by this filter. IfFile.lastModified()
plus age is greater than the current time, the file is filtered. The resolution is seconds. Defaults to 60 seconds.- Parameters:
age
- the ageunit
- the timeUnit.
-
getAge
Deprecated, for removal: This API element is subject to removal in a future version.since 6.2 in favor ofAbstractLastModifiedFileListFilter.getAgeDuration()
- Returns:
- the age in seconds.
-
getLastModified
- Specified by:
getLastModified
in classAbstractLastModifiedFileListFilter<File>
-
AbstractLastModifiedFileListFilter.getAgeDuration()