Spring Integration

org.springframework.integration.file.remote.synchronizer
Class AbstractInboundFileSynchronizer<F>

java.lang.Object
  extended by org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer<F>
All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean, InboundFileSynchronizer
Direct Known Subclasses:
FtpInboundFileSynchronizer, SftpInboundFileSynchronizer

public abstract class AbstractInboundFileSynchronizer<F>
extends java.lang.Object
implements InboundFileSynchronizer, org.springframework.beans.factory.InitializingBean

Base class charged with knowing how to connect to a remote file system, scan it for new files and then download the files.

The implementation should run through any configured FileListFilters to ensure the file entry is acceptable.

Since:
2.0
Author:
Josh Long, Mark Fisher, Oleg Zhurakousky

Field Summary
protected  org.apache.commons.logging.Log logger
           
 
Constructor Summary
AbstractInboundFileSynchronizer(SessionFactory<F> sessionFactory)
          Create a synchronizer with the SessionFactory used to acquire Session instances.
 
Method Summary
 void afterPropertiesSet()
           
protected  java.util.List<F> filterFiles(F[] files)
           
protected abstract  java.lang.String getFilename(F file)
           
protected  java.lang.String getTemporaryFileSuffix()
           
protected abstract  boolean isFile(F file)
           
 void setDeleteRemoteFiles(boolean deleteRemoteFiles)
           
 void setFilter(FileListFilter<F> filter)
           
 void setLocalFilenameGeneratorExpression(org.springframework.expression.Expression localFilenameGeneratorExpression)
           
 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.apache.commons.logging.Log logger
Constructor Detail

AbstractInboundFileSynchronizer

public AbstractInboundFileSynchronizer(SessionFactory<F> sessionFactory)
Create a synchronizer with the SessionFactory used to acquire Session instances.

Method Detail

setRemoteFileSeparator

public void setRemoteFileSeparator(java.lang.String remoteFileSeparator)

setLocalFilenameGeneratorExpression

public void setLocalFilenameGeneratorExpression(org.springframework.expression.Expression localFilenameGeneratorExpression)

setTemporaryFileSuffix

public void setTemporaryFileSuffix(java.lang.String temporaryFileSuffix)

setRemoteDirectory

public void setRemoteDirectory(java.lang.String remoteDirectory)
Specify the full path to the remote directory.


setFilter

public void setFilter(FileListFilter<F> filter)

setDeleteRemoteFiles

public void setDeleteRemoteFiles(boolean deleteRemoteFiles)

afterPropertiesSet

public final void afterPropertiesSet()
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean

filterFiles

protected final java.util.List<F> filterFiles(F[] files)

getTemporaryFileSuffix

protected java.lang.String getTemporaryFileSuffix()

synchronizeToLocalDirectory

public void synchronizeToLocalDirectory(java.io.File localDirectory)
Specified by:
synchronizeToLocalDirectory in interface InboundFileSynchronizer

isFile

protected abstract boolean isFile(F file)

getFilename

protected abstract java.lang.String getFilename(F file)

Spring Integration