Class GcsDiscardRecentModifiedFileListFilter
java.lang.Object
com.google.cloud.spring.storage.integration.filters.GcsDiscardRecentModifiedFileListFilter
- All Implemented Interfaces:
org.springframework.integration.file.filters.DiscardAwareFileListFilter<com.google.cloud.storage.BlobInfo>,org.springframework.integration.file.filters.FileListFilter<com.google.cloud.storage.BlobInfo>
public class GcsDiscardRecentModifiedFileListFilter
extends Object
implements org.springframework.integration.file.filters.DiscardAwareFileListFilter<com.google.cloud.storage.BlobInfo>
The
GcsDiscardRecentModifiedFileListFilter is a filter which excludes all files that were
updated less than some specified amount of time ago.
More specifically, it excludes all files whose BlobInfo.getUpdateTimeOffsetDateTime()
is within age of the current time.
When discardCallback is provided, it called for all the rejected files.
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct aGcsDiscardRecentModifiedFileListFilterinstance with providedage. -
Method Summary
Modifier and TypeMethodDescriptionbooleanaccept(com.google.cloud.storage.BlobInfo file) voidaddDiscardCallback(Consumer<com.google.cloud.storage.BlobInfo> discardCallbackToSet) List<com.google.cloud.storage.BlobInfo>filterFiles(com.google.cloud.storage.BlobInfo[] files) booleanMethods 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
-
Constructor Details
-
GcsDiscardRecentModifiedFileListFilter
Construct aGcsDiscardRecentModifiedFileListFilterinstance with providedage.- Parameters:
age-Durationdescribing the age of files to filter.
-
-
Method Details
-
addDiscardCallback
public void addDiscardCallback(@Nullable Consumer<com.google.cloud.storage.BlobInfo> discardCallbackToSet) - Specified by:
addDiscardCallbackin interfaceorg.springframework.integration.file.filters.DiscardAwareFileListFilter<com.google.cloud.storage.BlobInfo>
-
filterFiles
public List<com.google.cloud.storage.BlobInfo> filterFiles(com.google.cloud.storage.BlobInfo[] files) - Specified by:
filterFilesin interfaceorg.springframework.integration.file.filters.FileListFilter<com.google.cloud.storage.BlobInfo>
-
accept
public boolean accept(com.google.cloud.storage.BlobInfo file) - Specified by:
acceptin interfaceorg.springframework.integration.file.filters.FileListFilter<com.google.cloud.storage.BlobInfo>
-
supportsSingleFileFiltering
public boolean supportsSingleFileFiltering()- Specified by:
supportsSingleFileFilteringin interfaceorg.springframework.integration.file.filters.FileListFilter<com.google.cloud.storage.BlobInfo>
-