public class GcsDiscardRecentModifiedFileListFilter extends Object implements org.springframework.integration.file.filters.DiscardAwareFileListFilter<com.google.cloud.storage.BlobInfo>
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.getUpdateTime() is within
age of the current time.
When discardCallback is provided, it called for all the rejected files.
| Constructor and Description |
|---|
GcsDiscardRecentModifiedFileListFilter(Duration age)
Construct a
GcsDiscardRecentModifiedFileListFilter instance with provided age. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
accept(com.google.cloud.storage.BlobInfo file) |
void |
addDiscardCallback(Consumer<com.google.cloud.storage.BlobInfo> discardCallbackToSet) |
List<com.google.cloud.storage.BlobInfo> |
filterFiles(com.google.cloud.storage.BlobInfo[] files) |
boolean |
supportsSingleFileFiltering() |
public GcsDiscardRecentModifiedFileListFilter(Duration age)
GcsDiscardRecentModifiedFileListFilter instance with provided age.age - Duration describing the age of files to filter.public void addDiscardCallback(@Nullable
Consumer<com.google.cloud.storage.BlobInfo> discardCallbackToSet)
addDiscardCallback in interface org.springframework.integration.file.filters.DiscardAwareFileListFilter<com.google.cloud.storage.BlobInfo>public List<com.google.cloud.storage.BlobInfo> filterFiles(com.google.cloud.storage.BlobInfo[] files)
filterFiles in interface org.springframework.integration.file.filters.FileListFilter<com.google.cloud.storage.BlobInfo>public boolean accept(com.google.cloud.storage.BlobInfo file)
accept in interface org.springframework.integration.file.filters.FileListFilter<com.google.cloud.storage.BlobInfo>public boolean supportsSingleFileFiltering()
supportsSingleFileFiltering in interface org.springframework.integration.file.filters.FileListFilter<com.google.cloud.storage.BlobInfo>Copyright © 2024. All rights reserved.