public abstract class AbstractInboundFileSynchronizer<F> extends java.lang.Object implements InboundFileSynchronizer, org.springframework.beans.factory.InitializingBean, org.springframework.integration.expression.IntegrationEvaluationContextAware
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() |
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 |
setDeleteRemoteFiles(boolean deleteRemoteFiles) |
void |
setFilter(FileListFilter<F> filter) |
void |
setIntegrationEvaluationContext(org.springframework.expression.EvaluationContext evaluationContext) |
void |
setLocalFilenameGeneratorExpression(org.springframework.expression.Expression localFilenameGeneratorExpression) |
void |
setPreserveTimestamp(boolean preserveTimestamp) |
void |
setRemoteDirectory(java.lang.String remoteDirectory)
Specify the full path to the remote directory.
|
void |
setRemoteFileSeparator(java.lang.String remoteFileSeparator) |
void |
setTemporaryFileSuffix(java.lang.String temporaryFileSuffix) |
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)
public void setLocalFilenameGeneratorExpression(org.springframework.expression.Expression localFilenameGeneratorExpression)
public void setTemporaryFileSuffix(java.lang.String temporaryFileSuffix)
public void setRemoteDirectory(java.lang.String remoteDirectory)
remoteDirectory
- The remote directory.public void setFilter(FileListFilter<F> filter)
public void setDeleteRemoteFiles(boolean deleteRemoteFiles)
public void setPreserveTimestamp(boolean preserveTimestamp)
public void setIntegrationEvaluationContext(org.springframework.expression.EvaluationContext evaluationContext)
setIntegrationEvaluationContext
in interface org.springframework.integration.expression.IntegrationEvaluationContextAware
public final void afterPropertiesSet()
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
protected java.lang.String getTemporaryFileSuffix()
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)