public class FtpOutboundGateway extends AbstractRemoteFileOutboundGateway<org.apache.commons.net.ftp.FTPFile>
AbstractRemoteFileOutboundGateway.Command, AbstractRemoteFileOutboundGateway.OptionAbstractReplyProducingMessageHandler.RequestHandlerIntegrationManagement.ManagementOverridescommand, options, remoteFileTemplatemessagingTemplateEXPRESSION_PARSER, loggerMETER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME| Constructor and Description |
|---|
FtpOutboundGateway(RemoteFileTemplate<org.apache.commons.net.ftp.FTPFile> remoteFileTemplate,
MessageSessionCallback<org.apache.commons.net.ftp.FTPFile,?> messageSessionCallback)
Construct an instance with the supplied remote file template and callback
for performing operations on the session.
|
FtpOutboundGateway(RemoteFileTemplate<org.apache.commons.net.ftp.FTPFile> remoteFileTemplate,
java.lang.String command)
Construct an instance with the supplied remote file template
and command ('ls', 'nlst', 'put' or 'mput').
|
FtpOutboundGateway(RemoteFileTemplate<org.apache.commons.net.ftp.FTPFile> remoteFileTemplate,
java.lang.String command,
java.lang.String expression)
Construct an instance with the supplied remote file template, a command ('ls',
'get' etc), and an expression to determine the filename.
|
FtpOutboundGateway(SessionFactory<org.apache.commons.net.ftp.FTPFile> sessionFactory,
MessageSessionCallback<org.apache.commons.net.ftp.FTPFile,?> messageSessionCallback)
Construct an instance using the provided session factory and callback for
performing operations on the session.
|
FtpOutboundGateway(SessionFactory<org.apache.commons.net.ftp.FTPFile> sessionFactory,
java.lang.String command)
Construct an instance with the supplied session factory
and command ('ls', 'nlst', 'put' or 'mput').
|
FtpOutboundGateway(SessionFactory<org.apache.commons.net.ftp.FTPFile> sessionFactory,
java.lang.String command,
java.lang.String expression)
Construct an instance with the supplied session factory, a command ('ls', 'get'
etc), and an expression to determine the filename.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.util.List<AbstractFileInfo<org.apache.commons.net.ftp.FTPFile>> |
asFileInfoList(java.util.Collection<org.apache.commons.net.ftp.FTPFile> files) |
protected void |
doInit() |
protected org.apache.commons.net.ftp.FTPFile |
enhanceNameWithSubDirectory(org.apache.commons.net.ftp.FTPFile file,
java.lang.String directory) |
protected java.io.File |
get(org.springframework.messaging.Message<?> message,
Session<org.apache.commons.net.ftp.FTPFile> session,
java.lang.String remoteDir,
java.lang.String remoteFilePath,
java.lang.String remoteFilename,
org.apache.commons.net.ftp.FTPFile fileInfoParam)
Copy a remote file to the configured local directory.
|
java.lang.String |
getComponentType()
Subclasses may implement this method to provide component type information.
|
protected java.lang.String |
getFilename(AbstractFileInfo<org.apache.commons.net.ftp.FTPFile> file) |
protected java.lang.String |
getFilename(org.apache.commons.net.ftp.FTPFile file) |
protected long |
getModified(org.apache.commons.net.ftp.FTPFile file) |
protected boolean |
isDirectory(org.apache.commons.net.ftp.FTPFile file) |
protected boolean |
isLink(org.apache.commons.net.ftp.FTPFile file) |
protected java.util.List<?> |
ls(org.springframework.messaging.Message<?> message,
Session<org.apache.commons.net.ftp.FTPFile> session,
java.lang.String dir)
List remote files to local representation.
|
protected java.util.List<java.io.File> |
mGet(org.springframework.messaging.Message<?> message,
Session<org.apache.commons.net.ftp.FTPFile> session,
java.lang.String remoteDirectory,
java.lang.String remoteFilename) |
protected java.util.List<java.lang.String> |
mPut(org.springframework.messaging.Message<?> message,
Session<org.apache.commons.net.ftp.FTPFile> session,
java.io.File localDir)
Put files from the provided directory to the remote server recursively.
|
protected boolean |
mv(org.springframework.messaging.Message<?> message,
Session<org.apache.commons.net.ftp.FTPFile> session,
java.lang.String remoteFilePath,
java.lang.String remoteFileNewPath)
Move one remote path to another.
|
protected java.util.List<java.lang.String> |
nlst(org.springframework.messaging.Message<?> message,
Session<org.apache.commons.net.ftp.FTPFile> session,
java.lang.String dir)
List remote files names for the provided directory.
|
protected java.lang.String |
put(org.springframework.messaging.Message<?> message,
Session<org.apache.commons.net.ftp.FTPFile> session,
java.lang.String subDirectory)
Put the file based on the message to the remote server.
|
protected boolean |
rm(org.springframework.messaging.Message<?> message,
Session<org.apache.commons.net.ftp.FTPFile> session,
java.lang.String remoteFilePath)
Perform remote delete for the provided path.
|
void |
setWorkingDirExpression(org.springframework.expression.Expression workingDirExpression)
Specify an
Expression to evaluate FTP client working directory
against request message. |
void |
setWorkingDirExpressionString(java.lang.String workingDirExpression)
Specify a SpEL
Expression to evaluate FTP client working directory
against request message. |
doChmod, filterFiles, filterMputFiles, getRemoteFilename, handleRequestMessage, isChmodCapable, purgeDots, purgeLinks, setAutoCreateLocalDirectory, setChmod, setChmodOctal, setFileExistsMode, setFilter, setLocalDirectory, setLocalDirectoryExpression, setLocalDirectoryExpressionString, setLocalFilenameGeneratorExpression, setLocalFilenameGeneratorExpressionString, setMputFilter, setOption, setOptions, setRemoteFileSeparator, setRenameExpression, setRenameExpressionString, setTemporaryFileSuffixdoInvokeAdvisedRequestHandler, getRequiresReply, handleMessageInternal, hasAdviceChain, onInit, setAdviceChain, setBeanClassLoader, setRequiresReplyaddNotPropagatedHeaders, createOutputMessage, getNotPropagatedHeaders, getOutputChannel, isAsync, produceOutput, resolveErrorChannel, sendErrorMessage, sendOutput, sendOutputs, setAsync, setNotPropagatedHeaders, setOutputChannel, setOutputChannelName, setSendTimeout, shouldCopyRequestHeaders, shouldSplitOutput, updateNotPropagatedHeadersconfigureMetrics, getActiveCount, getActiveCountLong, getDuration, getErrorCount, getErrorCountLong, getHandleCount, getHandleCountLong, getManagedName, getManagedType, getMaxDuration, getMeanDuration, getMinDuration, getOrder, getOverrides, getStandardDeviationDuration, handleMessage, isCountsEnabled, isLoggingEnabled, isStatsEnabled, onComplete, onError, onNext, onSubscribe, registerMetricsCaptor, reset, setCountsEnabled, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, setStatsEnabledafterPropertiesSet, extractTypeIfPossible, getApplicationContext, getApplicationContextId, getBeanFactory, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetComponentNamepublic FtpOutboundGateway(SessionFactory<org.apache.commons.net.ftp.FTPFile> sessionFactory, MessageSessionCallback<org.apache.commons.net.ftp.FTPFile,?> messageSessionCallback)
sessionFactory - the session factory.messageSessionCallback - the callback.public FtpOutboundGateway(RemoteFileTemplate<org.apache.commons.net.ftp.FTPFile> remoteFileTemplate, MessageSessionCallback<org.apache.commons.net.ftp.FTPFile,?> messageSessionCallback)
remoteFileTemplate - the remote file template.messageSessionCallback - the callback.public FtpOutboundGateway(SessionFactory<org.apache.commons.net.ftp.FTPFile> sessionFactory, java.lang.String command, java.lang.String expression)
sessionFactory - the session factory.command - the command.expression - the filename expression.public FtpOutboundGateway(RemoteFileTemplate<org.apache.commons.net.ftp.FTPFile> remoteFileTemplate, java.lang.String command, java.lang.String expression)
remoteFileTemplate - the remote file template.command - the command.expression - the filename expression.public FtpOutboundGateway(SessionFactory<org.apache.commons.net.ftp.FTPFile> sessionFactory, java.lang.String command)
The remoteDirectory expression is null assuming to use
the workingDirectory from the FTP Client.
sessionFactory - the session factory.command - the command.public FtpOutboundGateway(RemoteFileTemplate<org.apache.commons.net.ftp.FTPFile> remoteFileTemplate, java.lang.String command)
The remoteDirectory expression is null assuming to use
the workingDirectory from the FTP Client.
remoteFileTemplate - the remote file template.command - the command.public void setWorkingDirExpression(org.springframework.expression.Expression workingDirExpression)
Expression to evaluate FTP client working directory
against request message.workingDirExpression - the expression to evaluate working directorypublic void setWorkingDirExpressionString(java.lang.String workingDirExpression)
Expression to evaluate FTP client working directory
against request message.workingDirExpression - the SpEL expression to evaluate working directorypublic java.lang.String getComponentType()
IntegrationObjectSupportgetComponentType in interface NamedComponentgetComponentType in class AbstractMessageHandlerprotected boolean isDirectory(org.apache.commons.net.ftp.FTPFile file)
isDirectory in class AbstractRemoteFileOutboundGateway<org.apache.commons.net.ftp.FTPFile>protected boolean isLink(org.apache.commons.net.ftp.FTPFile file)
isLink in class AbstractRemoteFileOutboundGateway<org.apache.commons.net.ftp.FTPFile>protected java.lang.String getFilename(org.apache.commons.net.ftp.FTPFile file)
getFilename in class AbstractRemoteFileOutboundGateway<org.apache.commons.net.ftp.FTPFile>protected java.lang.String getFilename(AbstractFileInfo<org.apache.commons.net.ftp.FTPFile> file)
getFilename in class AbstractRemoteFileOutboundGateway<org.apache.commons.net.ftp.FTPFile>protected long getModified(org.apache.commons.net.ftp.FTPFile file)
getModified in class AbstractRemoteFileOutboundGateway<org.apache.commons.net.ftp.FTPFile>protected java.util.List<AbstractFileInfo<org.apache.commons.net.ftp.FTPFile>> asFileInfoList(java.util.Collection<org.apache.commons.net.ftp.FTPFile> files)
asFileInfoList in class AbstractRemoteFileOutboundGateway<org.apache.commons.net.ftp.FTPFile>protected void doInit()
doInit in class AbstractRemoteFileOutboundGateway<org.apache.commons.net.ftp.FTPFile>protected org.apache.commons.net.ftp.FTPFile enhanceNameWithSubDirectory(org.apache.commons.net.ftp.FTPFile file,
java.lang.String directory)
enhanceNameWithSubDirectory in class AbstractRemoteFileOutboundGateway<org.apache.commons.net.ftp.FTPFile>protected java.util.List<?> ls(org.springframework.messaging.Message<?> message,
Session<org.apache.commons.net.ftp.FTPFile> session,
java.lang.String dir)
throws java.io.IOException
AbstractRemoteFileOutboundGatewayls in class AbstractRemoteFileOutboundGateway<org.apache.commons.net.ftp.FTPFile>message - the message related to the list requestsession - the session to perform list commanddir - the remote directory to list contentjava.io.IOException - the IO exception during performing remote commandprotected java.util.List<java.lang.String> nlst(org.springframework.messaging.Message<?> message,
Session<org.apache.commons.net.ftp.FTPFile> session,
java.lang.String dir)
throws java.io.IOException
AbstractRemoteFileOutboundGatewaynlst in class AbstractRemoteFileOutboundGateway<org.apache.commons.net.ftp.FTPFile>message - the message related to the current requestsession - the session to perform list file names commanddir - the remote directory to list file namesjava.io.IOException - the IO exception during performing remote commandprotected java.io.File get(org.springframework.messaging.Message<?> message,
Session<org.apache.commons.net.ftp.FTPFile> session,
java.lang.String remoteDir,
java.lang.String remoteFilePath,
java.lang.String remoteFilename,
org.apache.commons.net.ftp.FTPFile fileInfoParam)
throws java.io.IOException
AbstractRemoteFileOutboundGatewayget in class AbstractRemoteFileOutboundGateway<org.apache.commons.net.ftp.FTPFile>message - the message.session - the session.remoteDir - the remote directory.remoteFilePath - the remote file path.remoteFilename - the remote file name.fileInfoParam - the remote file info; if null we will execute an 'ls' command
first.java.io.IOException - Any IOException.protected java.util.List<java.io.File> mGet(org.springframework.messaging.Message<?> message,
Session<org.apache.commons.net.ftp.FTPFile> session,
java.lang.String remoteDirectory,
java.lang.String remoteFilename)
throws java.io.IOException
mGet in class AbstractRemoteFileOutboundGateway<org.apache.commons.net.ftp.FTPFile>java.io.IOExceptionprotected boolean rm(org.springframework.messaging.Message<?> message,
Session<org.apache.commons.net.ftp.FTPFile> session,
java.lang.String remoteFilePath)
throws java.io.IOException
AbstractRemoteFileOutboundGatewayrm in class AbstractRemoteFileOutboundGateway<org.apache.commons.net.ftp.FTPFile>message - the request message related to the path to removesession - the remote protocol session to perform remove commandremoteFilePath - the remote path to removejava.io.IOException - the IO exception during performing remote commandprotected boolean mv(org.springframework.messaging.Message<?> message,
Session<org.apache.commons.net.ftp.FTPFile> session,
java.lang.String remoteFilePath,
java.lang.String remoteFileNewPath)
throws java.io.IOException
AbstractRemoteFileOutboundGatewaymv in class AbstractRemoteFileOutboundGateway<org.apache.commons.net.ftp.FTPFile>message - the request message related to this move commandsession - the remote protocol session to perform move commandremoteFilePath - the source remote pathremoteFileNewPath - the target remote pathjava.io.IOException - the IO exception during performing remote commandprotected java.lang.String put(org.springframework.messaging.Message<?> message,
Session<org.apache.commons.net.ftp.FTPFile> session,
java.lang.String subDirectory)
AbstractRemoteFileOutboundGatewayput in class AbstractRemoteFileOutboundGateway<org.apache.commons.net.ftp.FTPFile>message - the request message related to this put commandsession - the remote protocol session related to this invocation contextsubDirectory - the target sub directory to putprotected java.util.List<java.lang.String> mPut(org.springframework.messaging.Message<?> message,
Session<org.apache.commons.net.ftp.FTPFile> session,
java.io.File localDir)
AbstractRemoteFileOutboundGatewaymPut in class AbstractRemoteFileOutboundGateway<org.apache.commons.net.ftp.FTPFile>message - the request message related to this mPut commandsession - the remote protocol session for this invocation contextlocalDir - the local directory to mput to the server