public abstract class AbstractInboundFileSynchronizer<F> extends java.lang.Object implements InboundFileSynchronizer, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.InitializingBean, java.io.Closeable
The implementation should run through any configured
FileListFilter
s 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 void |
copyFileToLocalDirectory(java.lang.String remoteDirectoryPath,
F remoteFile,
java.io.File localDirectory,
Session<F> session) |
protected java.util.List<F> |
filterFiles(F[] files) |
protected abstract java.lang.String |
getFilename(F file) |
protected abstract long |
getModified(F file) |
protected java.lang.String |
getTemporaryFileSuffix() |
protected abstract boolean |
isFile(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(java.lang.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(java.lang.String remoteFileSeparator) |
void |
setTemporaryFileSuffix(java.lang.String temporaryFileSuffix)
Set a temporary file suffix to be used while transferring files.
|
void |
synchronizeToLocalDirectory(java.io.File localDirectory) |
public AbstractInboundFileSynchronizer(SessionFactory<F> sessionFactory)
SessionFactory
used to acquire Session
instances.sessionFactory
- The session factory.public void setRemoteFileSeparator(java.lang.String remoteFileSeparator)
remoteFileSeparator
- the remote file separator.RemoteFileTemplate.setRemoteFileSeparator(String)
public void setLocalFilenameGeneratorExpression(org.springframework.expression.Expression localFilenameGeneratorExpression)
localFilenameGeneratorExpression
- the expression.public void setTemporaryFileSuffix(java.lang.String temporaryFileSuffix)
temporaryFileSuffix
- the file suffix.public void setRemoteDirectory(java.lang.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.BeanFactoryAware
org.springframework.beans.BeansException
public final void afterPropertiesSet()
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
protected java.lang.String getTemporaryFileSuffix()
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
public void synchronizeToLocalDirectory(java.io.File localDirectory)
synchronizeToLocalDirectory
in interface InboundFileSynchronizer
protected void copyFileToLocalDirectory(java.lang.String remoteDirectoryPath, F remoteFile, java.io.File localDirectory, Session<F> session) throws java.io.IOException
java.io.IOException
protected abstract boolean isFile(F file)
protected abstract java.lang.String getFilename(F file)
protected abstract long getModified(F file)