Class GcsAcceptModifiedAfterFileListFilter
java.lang.Object
com.google.cloud.spring.storage.integration.filters.GcsAcceptModifiedAfterFileListFilter
- 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 GcsAcceptModifiedAfterFileListFilter
extends Object
implements org.springframework.integration.file.filters.DiscardAwareFileListFilter<com.google.cloud.storage.BlobInfo>
The
GcsAcceptModifiedAfterFileListFilter is a filter which accepts all files that were
modified after a specified point in time.
More specifically, it accepts (includes) all files whose
BlobInfo.getUpdateTimeOffsetDateTime() is after (greater than or equal to) the
acceptAfterCutoffTimestamp.
acceptAfterCutoffTimestamp defaults to Instant.now() (UTC) in millis, but an
alternative Instant can be provided via the constructor.
When discardCallback is provided, it is called for all the rejected files.
-
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionbooleanaccept(com.google.cloud.storage.BlobInfo file) voidaddDiscardCallback(Consumer<com.google.cloud.storage.BlobInfo> discardCallback) List<com.google.cloud.storage.BlobInfo>filterFiles(com.google.cloud.storage.BlobInfo[] blobInfos) 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
-
GcsAcceptModifiedAfterFileListFilter
public GcsAcceptModifiedAfterFileListFilter() -
GcsAcceptModifiedAfterFileListFilter
-
-
Method Details
-
addDiscardCallback
public void addDiscardCallback(@Nullable Consumer<com.google.cloud.storage.BlobInfo> discardCallback) - 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[] blobInfos) - 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>
-