public class InboundFileSynchronizationImpl extends java.lang.Object implements InboundFileSynchronizer, org.springframework.beans.factory.InitializingBean
InboundFileSynchronizer, this implementation will use
the AmazonS3Operations to list the objects in the remote bucket on invocation of
the synchronizeToLocalDirectory(File, String, String). The listed objects will then
be checked against the| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CONTENT_MD5 |
| Constructor and Description |
|---|
InboundFileSynchronizationImpl(AmazonS3Operations client,
InboundLocalFileOperations fileOperations) |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
void |
setAcceptSubFolders(boolean acceptSubFolders)
Set the value to true to enable the objects to be accepted even if they
are present in the sub folder of the remote folder passed to
InboundFileSynchronizer.synchronizeToLocalDirectory(File, String, String) |
void |
setFileNamePattern(java.lang.String fileNameRegex)
Sets the file name regex that will be used to match the key value from S3
to find a match.
|
void |
setFileWildcard(java.lang.String fileWildcard)
Sets the simple file name wildcard to match to match the file e.g., it can be
set to *.txt to accept all .txt files
|
void |
setSynchronizingBatchSize(int batchSize)
Sets the max number of Files to synchronize at a time.
|
void |
synchronizeToLocalDirectory(java.io.File localDirectory,
java.lang.String bucketName,
java.lang.String remoteFolder)
The operation synchronizes the remote S3 file system with the local directory
It retrieved new files and updates existing ones with the latest content from S3
Please note that this method will NOT delete any additional files present on the
local filesystem
|
public static final java.lang.String CONTENT_MD5
public InboundFileSynchronizationImpl(AmazonS3Operations client, InboundLocalFileOperations fileOperations)
client - public void afterPropertiesSet()
throws java.lang.Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanjava.lang.Exceptionpublic void synchronizeToLocalDirectory(java.io.File localDirectory,
java.lang.String bucketName,
java.lang.String remoteFolder)
InboundFileSynchronizersynchronizeToLocalDirectory in interface InboundFileSynchronizerlocalDirectory - The local directory that needs to be synchronized with the Remote S3 bucketbucketName - The name of the bucket whose contents are to be synchronizedremoteFolder - The folder name in S3 whose contents are to be synchronized
use / if the contents of the bucket starting from the root
are to be synchronized. This operation will only synchronize
the files resent in the given remote folder and will ignore
all the folders and sub folder in it.public void setSynchronizingBatchSize(int batchSize)
InboundFileSynchronizersetSynchronizingBatchSize in interface InboundFileSynchronizerpublic void setFileNamePattern(java.lang.String fileNameRegex)
InboundFileSynchronizersetFileNamePattern in interface InboundFileSynchronizerpublic void setFileWildcard(java.lang.String fileWildcard)
InboundFileSynchronizersetFileWildcard in interface InboundFileSynchronizerpublic void setAcceptSubFolders(boolean acceptSubFolders)
InboundFileSynchronizerInboundFileSynchronizer.synchronizeToLocalDirectory(File, String, String)setAcceptSubFolders in interface InboundFileSynchronizer