org.springframework.integration.file.remote.gateway
Class AbstractRemoteFileOutboundGateway<F>
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.handler.AbstractMessageHandler
org.springframework.integration.handler.AbstractReplyProducingMessageHandler
org.springframework.integration.file.remote.gateway.AbstractRemoteFileOutboundGateway<F>
- All Implemented Interfaces:
- org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean, org.springframework.core.Ordered, org.springframework.integration.context.NamedComponent, org.springframework.integration.context.Orderable, org.springframework.integration.core.MessageHandler, org.springframework.integration.core.MessageProducer, org.springframework.integration.history.TrackableComponent
public abstract class AbstractRemoteFileOutboundGateway<F>
- extends org.springframework.integration.handler.AbstractReplyProducingMessageHandler
Base class for Outbound Gateways that perform remote file operations.
- Since:
- 2.1
| Nested classes/interfaces inherited from class org.springframework.integration.handler.AbstractReplyProducingMessageHandler |
org.springframework.integration.handler.AbstractReplyProducingMessageHandler.RequestHandler |
| Fields inherited from class org.springframework.integration.context.IntegrationObjectSupport |
logger |
| Fields inherited from interface org.springframework.core.Ordered |
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE |
| Methods inherited from class org.springframework.integration.handler.AbstractReplyProducingMessageHandler |
getMessagingTemplate, handleMessageInternal, setAdviceChain, setBeanClassLoader, setChannelResolver, setOutputChannel, setRequiresReply, setSendTimeout, shouldCopyRequestHeaders |
| Methods inherited from class org.springframework.integration.handler.AbstractMessageHandler |
getComponentType, getOrder, handleMessage, setOrder, setShouldTrack |
| Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport |
afterPropertiesSet, getBeanFactory, getComponentName, getConversionService, getTaskScheduler, setBeanFactory, setBeanName, setComponentName, setConversionService, setTaskScheduler, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.springframework.integration.context.NamedComponent |
getComponentName |
sessionFactory
protected final SessionFactory<F> sessionFactory
command
protected final java.lang.String command
COMMAND_LS
public static final java.lang.String COMMAND_LS
- See Also:
- Constant Field Values
COMMAND_GET
public static final java.lang.String COMMAND_GET
- See Also:
- Constant Field Values
COMMAND_RM
public static final java.lang.String COMMAND_RM
- See Also:
- Constant Field Values
COMMAND_MGET
public static final java.lang.String COMMAND_MGET
- See Also:
- Constant Field Values
OPTION_NAME_ONLY
public static final java.lang.String OPTION_NAME_ONLY
- See Also:
- Constant Field Values
OPTION_ALL
public static final java.lang.String OPTION_ALL
- See Also:
- Constant Field Values
OPTION_NOSORT
public static final java.lang.String OPTION_NOSORT
- See Also:
- Constant Field Values
OPTION_SUBDIRS
public static final java.lang.String OPTION_SUBDIRS
- See Also:
- Constant Field Values
OPTION_LINKS
public static final java.lang.String OPTION_LINKS
- See Also:
- Constant Field Values
OPTION_PRESERVE_TIMESTAMP
public static final java.lang.String OPTION_PRESERVE_TIMESTAMP
- See Also:
- Constant Field Values
OPTION_EXCEPTION_WHEN_EMPTY
public static final java.lang.String OPTION_EXCEPTION_WHEN_EMPTY
- See Also:
- Constant Field Values
options
protected volatile java.util.Set<java.lang.String> options
AbstractRemoteFileOutboundGateway
public AbstractRemoteFileOutboundGateway(SessionFactory<F> sessionFactory,
java.lang.String command,
java.lang.String expression)
setOptions
public void setOptions(java.lang.String options)
- Parameters:
options - the options to set
setRemoteFileSeparator
public void setRemoteFileSeparator(java.lang.String remoteFileSeparator)
- Parameters:
remoteFileSeparator - the remoteFileSeparator to set
setLocalDirectory
public void setLocalDirectory(java.io.File localDirectory)
- Parameters:
localDirectory - the localDirectory to set
setAutoCreateLocalDirectory
public void setAutoCreateLocalDirectory(boolean autoCreateLocalDirectory)
- Parameters:
autoCreateLocalDirectory - the autoCreateLocalDirectory to set
setTemporaryFileSuffix
public void setTemporaryFileSuffix(java.lang.String temporaryFileSuffix)
- Parameters:
temporaryFileSuffix - the temporaryFileSuffix to set
setFilter
public void setFilter(FileListFilter<F> filter)
- Parameters:
filter - the filter to set
onInit
protected void onInit()
- Overrides:
onInit in class org.springframework.integration.handler.AbstractReplyProducingMessageHandler
handleRequestMessage
protected java.lang.Object handleRequestMessage(org.springframework.integration.Message<?> requestMessage)
- Specified by:
handleRequestMessage in class org.springframework.integration.handler.AbstractReplyProducingMessageHandler
ls
protected java.util.List<?> ls(Session<F> session,
java.lang.String dir)
throws java.io.IOException
- Throws:
java.io.IOException
filterFiles
protected final java.util.List<F> filterFiles(F[] files)
purgeLinks
protected void purgeLinks(java.util.List<F> lsFiles)
purgeDots
protected void purgeDots(java.util.List<F> lsFiles)
get
protected java.io.File get(Session<F> session,
java.lang.String remoteFilePath,
java.lang.String remoteFilename,
boolean lsFirst)
throws java.io.IOException
- Copy a remote file to the configured local directory.
- Parameters:
session - remoteFilePath -
- Throws:
java.io.IOException
mGet
protected java.util.List<java.io.File> mGet(Session<F> session,
java.lang.String remoteDirectory,
java.lang.String remoteFilename)
throws java.io.IOException
- Throws:
java.io.IOException
getRemoteFilename
protected java.lang.String getRemoteFilename(java.lang.String remoteFilePath)
- Parameters:
remoteFilePath -
rm
protected boolean rm(Session<?> session,
java.lang.String remoteFilePath)
throws java.io.IOException
- Throws:
java.io.IOException
isDirectory
protected abstract boolean isDirectory(F file)
isLink
protected abstract boolean isLink(F file)
getFilename
protected abstract java.lang.String getFilename(F file)
getModified
protected abstract long getModified(F file)
asFileInfoList
protected abstract java.util.List<AbstractFileInfo<F>> asFileInfoList(java.util.Collection<F> files)