public abstract class AbstractInboundFileSynchronizer<F> extends Object implements InboundFileSynchronizer, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.InitializingBean, Closeable
The implementation should run through any configured
FileListFilters to
ensure the file entry is acceptable.
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.commons.logging.Log |
logger |
| Constructor and Description |
|---|
AbstractInboundFileSynchronizer(SessionFactory<F> sessionFactory)
Create a synchronizer with the
SessionFactory used to acquire Session instances. |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
void |
close() |
protected boolean |
copyFileToLocalDirectory(String remoteDirectoryPath,
F remoteFile,
File localDirectory,
Session<F> session) |
protected void |
doInit()
Subclasses can override to perform initialization - called from
InitializingBean.afterPropertiesSet(). |
protected List<F> |
filterFiles(F[] files) |
protected abstract String |
getFilename(F file) |
protected abstract long |
getModified(F file) |
protected String |
getTemporaryFileSuffix() |
protected abstract boolean |
isFile(F file) |
protected void |
rollbackFromFileToListEnd(List<F> filteredFiles,
F file) |
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) |
void |
setDeleteRemoteFiles(boolean deleteRemoteFiles)
Set to true to enable deletion of remote files after successful transfer.
|
void |
setFilter(FileListFilter<F> filter)
Set the filter to be applied to the remote files before transferring.
|
void |
setIntegrationEvaluationContext(org.springframework.expression.EvaluationContext evaluationContext) |
void |
setLocalFilenameGeneratorExpression(org.springframework.expression.Expression localFilenameGeneratorExpression)
Set an expression used to determine the local file name.
|
void |
setPreserveTimestamp(boolean preserveTimestamp)
Set to true to enable the preservation of the remote file timestamp when
transferring.
|
void |
setRemoteDirectory(String remoteDirectory)
Specify the full path to the remote directory.
|
void |
setRemoteDirectoryExpression(org.springframework.expression.Expression remoteDirectoryExpression)
Specify an expression that evaluates to the full path to the remote directory.
|
void |
setRemoteFileSeparator(String remoteFileSeparator) |
void |
setTemporaryFileSuffix(String temporaryFileSuffix)
Set a temporary file suffix to be used while transferring files.
|
void |
synchronizeToLocalDirectory(File localDirectory) |
public AbstractInboundFileSynchronizer(SessionFactory<F> sessionFactory)
SessionFactory used to acquire Session instances.sessionFactory - The session factory.public void setRemoteFileSeparator(String remoteFileSeparator)
remoteFileSeparator - the remote file separator.RemoteFileTemplate.setRemoteFileSeparator(String)public void setLocalFilenameGeneratorExpression(org.springframework.expression.Expression localFilenameGeneratorExpression)
localFilenameGeneratorExpression - the expression.public void setTemporaryFileSuffix(String temporaryFileSuffix)
temporaryFileSuffix - the file suffix.public void setRemoteDirectory(String remoteDirectory)
remoteDirectory - The remote directory.public void setRemoteDirectoryExpression(org.springframework.expression.Expression remoteDirectoryExpression)
remoteDirectoryExpression - The remote directory expression.public void setFilter(FileListFilter<F> filter)
filter - the file list filter.public void setDeleteRemoteFiles(boolean deleteRemoteFiles)
deleteRemoteFiles - true to delete.public void setPreserveTimestamp(boolean preserveTimestamp)
preserveTimestamp - true to preserve.public void setIntegrationEvaluationContext(org.springframework.expression.EvaluationContext evaluationContext)
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
throws org.springframework.beans.BeansException
setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAwareorg.springframework.beans.BeansExceptionpublic final void afterPropertiesSet()
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanprotected void doInit()
InitializingBean.afterPropertiesSet().protected String getTemporaryFileSuffix()
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic void synchronizeToLocalDirectory(File localDirectory)
synchronizeToLocalDirectory in interface InboundFileSynchronizerprotected boolean copyFileToLocalDirectory(String remoteDirectoryPath, F remoteFile, File localDirectory, Session<F> session) throws IOException
IOExceptionprotected abstract boolean isFile(F file)
protected abstract long getModified(F file)