Class GcsDiscardRecentModifiedFileListFilter
- java.lang.Object
-
- com.google.cloud.spring.storage.integration.filters.GcsDiscardRecentModifiedFileListFilter
-
- All Implemented Interfaces:
org.springframework.integration.file.filters.DiscardAwareFileListFilter<BlobInfo>,org.springframework.integration.file.filters.FileListFilter<BlobInfo>
public class GcsDiscardRecentModifiedFileListFilter extends Object implements org.springframework.integration.file.filters.DiscardAwareFileListFilter<BlobInfo>
TheGcsDiscardRecentModifiedFileListFilteris 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.getUpdateTime()is withinageof the current time.When
discardCallbackis provided, it called for all the rejected files.
-
-
Constructor Summary
Constructors Constructor Description GcsDiscardRecentModifiedFileListFilter(Duration age)Construct aGcsDiscardRecentModifiedFileListFilterinstance with providedage.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaccept(BlobInfo file)voidaddDiscardCallback(Consumer<BlobInfo> discardCallbackToSet)List<BlobInfo>filterFiles(BlobInfo[] files)booleansupportsSingleFileFiltering()
-
-
-
Constructor Detail
-
GcsDiscardRecentModifiedFileListFilter
public GcsDiscardRecentModifiedFileListFilter(Duration age)
Construct aGcsDiscardRecentModifiedFileListFilterinstance with providedage.- Parameters:
age-Durationdescribing the age of files to filter.
-
-
Method Detail
-
addDiscardCallback
public void addDiscardCallback(@Nullable Consumer<BlobInfo> discardCallbackToSet)- Specified by:
addDiscardCallbackin interfaceorg.springframework.integration.file.filters.DiscardAwareFileListFilter<BlobInfo>
-
filterFiles
public List<BlobInfo> filterFiles(BlobInfo[] files)
- Specified by:
filterFilesin interfaceorg.springframework.integration.file.filters.FileListFilter<BlobInfo>
-
accept
public boolean accept(BlobInfo file)
- Specified by:
acceptin interfaceorg.springframework.integration.file.filters.FileListFilter<BlobInfo>
-
supportsSingleFileFiltering
public boolean supportsSingleFileFiltering()
- Specified by:
supportsSingleFileFilteringin interfaceorg.springframework.integration.file.filters.FileListFilter<BlobInfo>
-
-