public class GcsDiscardRecentModifiedFileListFilter extends Object implements org.springframework.integration.file.filters.DiscardAwareFileListFilter<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(BlobInfo file) |
void |
addDiscardCallback(Consumer<BlobInfo> discardCallbackToSet) |
List<BlobInfo> |
filterFiles(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<BlobInfo> discardCallbackToSet)
addDiscardCallback
in interface org.springframework.integration.file.filters.DiscardAwareFileListFilter<BlobInfo>
public List<BlobInfo> filterFiles(BlobInfo[] files)
filterFiles
in interface org.springframework.integration.file.filters.FileListFilter<BlobInfo>
public boolean accept(BlobInfo file)
accept
in interface org.springframework.integration.file.filters.FileListFilter<BlobInfo>
public boolean supportsSingleFileFiltering()
supportsSingleFileFiltering
in interface org.springframework.integration.file.filters.FileListFilter<BlobInfo>
Copyright © 2022. All rights reserved.