Class SftpOutboundGateway
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.handler.MessageHandlerSupport
org.springframework.integration.handler.AbstractMessageHandler
org.springframework.integration.handler.AbstractMessageProducingHandler
org.springframework.integration.handler.AbstractReplyProducingMessageHandler
org.springframework.integration.file.remote.gateway.AbstractRemoteFileOutboundGateway<com.jcraft.jsch.ChannelSftp.LsEntry>
org.springframework.integration.sftp.gateway.SftpOutboundGateway
- All Implemented Interfaces:
org.reactivestreams.Subscriber<org.springframework.messaging.Message<?>>
,org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanClassLoaderAware
,org.springframework.beans.factory.BeanFactoryAware
,org.springframework.beans.factory.BeanNameAware
,org.springframework.beans.factory.DisposableBean
,org.springframework.beans.factory.InitializingBean
,org.springframework.context.ApplicationContextAware
,org.springframework.core.Ordered
,org.springframework.integration.context.ExpressionCapable
,org.springframework.integration.context.Orderable
,org.springframework.integration.core.MessageProducer
,org.springframework.integration.handler.HeaderPropagationAware
,org.springframework.integration.IntegrationPattern
,org.springframework.integration.support.context.NamedComponent
,org.springframework.integration.support.management.IntegrationManagement
,org.springframework.integration.support.management.TrackableComponent
,org.springframework.messaging.MessageHandler
,reactor.core.CoreSubscriber<org.springframework.messaging.Message<?>>
public class SftpOutboundGateway
extends org.springframework.integration.file.remote.gateway.AbstractRemoteFileOutboundGateway<com.jcraft.jsch.ChannelSftp.LsEntry>
Outbound Gateway for performing remote file operations via SFTP.
- Since:
- 2.1
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.integration.file.remote.gateway.AbstractRemoteFileOutboundGateway
org.springframework.integration.file.remote.gateway.AbstractRemoteFileOutboundGateway.Command, org.springframework.integration.file.remote.gateway.AbstractRemoteFileOutboundGateway.Option
-
Field Summary
Fields inherited from class org.springframework.integration.handler.AbstractMessageProducingHandler
messagingTemplate
Fields inherited from class org.springframework.integration.context.IntegrationObjectSupport
EXPRESSION_PARSER, logger
-
Constructor Summary
Constructors Constructor Description SftpOutboundGateway(org.springframework.integration.file.remote.RemoteFileTemplate<com.jcraft.jsch.ChannelSftp.LsEntry> 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.SftpOutboundGateway(org.springframework.integration.file.remote.RemoteFileTemplate<com.jcraft.jsch.ChannelSftp.LsEntry> remoteFileTemplate, org.springframework.integration.file.remote.MessageSessionCallback<com.jcraft.jsch.ChannelSftp.LsEntry,?> messageSessionCallback)
Construct an instance with the supplied remote file template and callback for performing operations on the session.SftpOutboundGateway(org.springframework.integration.file.remote.session.SessionFactory<com.jcraft.jsch.ChannelSftp.LsEntry> 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.SftpOutboundGateway(org.springframework.integration.file.remote.session.SessionFactory<com.jcraft.jsch.ChannelSftp.LsEntry> sessionFactory, org.springframework.integration.file.remote.MessageSessionCallback<com.jcraft.jsch.ChannelSftp.LsEntry,?> messageSessionCallback)
Construct an instance using the provided session factory and callback for performing operations on the session. -
Method Summary
Modifier and Type Method Description protected java.util.List<org.springframework.integration.file.remote.AbstractFileInfo<com.jcraft.jsch.ChannelSftp.LsEntry>>
asFileInfoList(java.util.Collection<com.jcraft.jsch.ChannelSftp.LsEntry> files)
protected void
doChmod(org.springframework.integration.file.remote.RemoteFileOperations<com.jcraft.jsch.ChannelSftp.LsEntry> remoteFileOperations, java.lang.String path, int chmod)
protected com.jcraft.jsch.ChannelSftp.LsEntry
enhanceNameWithSubDirectory(com.jcraft.jsch.ChannelSftp.LsEntry file, java.lang.String directory)
java.lang.String
getComponentType()
protected java.lang.String
getFilename(com.jcraft.jsch.ChannelSftp.LsEntry file)
protected java.lang.String
getFilename(org.springframework.integration.file.remote.AbstractFileInfo<com.jcraft.jsch.ChannelSftp.LsEntry> file)
protected long
getModified(com.jcraft.jsch.ChannelSftp.LsEntry file)
boolean
isChmodCapable()
protected boolean
isDirectory(com.jcraft.jsch.ChannelSftp.LsEntry file)
protected boolean
isLink(com.jcraft.jsch.ChannelSftp.LsEntry file)
Methods inherited from class org.springframework.integration.file.remote.gateway.AbstractRemoteFileOutboundGateway
assertRemoteFileTemplateMutability, doInit, filterFile, filterFiles, filterMputFiles, get, getRemoteFilename, getRemoteFileTemplate, handleRequestMessage, ls, mGet, mPut, mv, nlst, purgeDots, purgeLinks, put, remoteFileTemplateExplicitlySet, rm, setAutoCreateDirectory, setAutoCreateLocalDirectory, setCharset, setChmod, setChmodOctal, setFileExistsMode, setFileNameExpression, setFileNameGenerator, setFilter, setLocalDirectory, setLocalDirectoryExpression, setLocalDirectoryExpressionString, setLocalFilenameGeneratorExpression, setLocalFilenameGeneratorExpressionString, setMputFilter, setOption, setOptions, setRemoteDirectoryExpression, setRemoteFileSeparator, setRenameExpression, setRenameExpressionString, setTemporaryFileSuffix, setTemporaryRemoteDirectoryExpression, setUseTemporaryFileName
Methods inherited from class org.springframework.integration.handler.AbstractReplyProducingMessageHandler
doInvokeAdvisedRequestHandler, getBeanClassLoader, getIntegrationPatternType, getRequiresReply, handleMessageInternal, hasAdviceChain, onInit, setAdviceChain, setBeanClassLoader, setRequiresReply
Methods inherited from class org.springframework.integration.handler.AbstractMessageProducingHandler
addNotPropagatedHeaders, createOutputMessage, getNotPropagatedHeaders, getOutputChannel, isAsync, messageBuilderForReply, produceOutput, resolveErrorChannel, sendErrorMessage, sendOutput, sendOutputs, setAsync, setNotPropagatedHeaders, setOutputChannel, setOutputChannelName, setSendTimeout, shouldCopyRequestHeaders, shouldSplitOutput, updateNotPropagatedHeaders
Methods inherited from class org.springframework.integration.handler.AbstractMessageHandler
handleMessage, onComplete, onError, onNext, onSubscribe
Methods inherited from class org.springframework.integration.handler.MessageHandlerSupport
buildSendTimer, destroy, getManagedName, getManagedType, getMetricsCaptor, getOrder, getOverrides, isLoggingEnabled, registerMetricsCaptor, sendTimer, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, shouldTrack
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Constructor Details
-
SftpOutboundGateway
public SftpOutboundGateway(org.springframework.integration.file.remote.session.SessionFactory<com.jcraft.jsch.ChannelSftp.LsEntry> sessionFactory, org.springframework.integration.file.remote.MessageSessionCallback<com.jcraft.jsch.ChannelSftp.LsEntry,?> messageSessionCallback)Construct an instance using the provided session factory and callback for performing operations on the session.- Parameters:
sessionFactory
- the session factory.messageSessionCallback
- the callback.
-
SftpOutboundGateway
public SftpOutboundGateway(org.springframework.integration.file.remote.RemoteFileTemplate<com.jcraft.jsch.ChannelSftp.LsEntry> remoteFileTemplate, org.springframework.integration.file.remote.MessageSessionCallback<com.jcraft.jsch.ChannelSftp.LsEntry,?> messageSessionCallback)Construct an instance with the supplied remote file template and callback for performing operations on the session.- Parameters:
remoteFileTemplate
- the remote file template.messageSessionCallback
- the callback.
-
SftpOutboundGateway
public SftpOutboundGateway(org.springframework.integration.file.remote.session.SessionFactory<com.jcraft.jsch.ChannelSftp.LsEntry> 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.- Parameters:
sessionFactory
- the session factory.command
- the command.expression
- the filename expression.
-
SftpOutboundGateway
public SftpOutboundGateway(org.springframework.integration.file.remote.RemoteFileTemplate<com.jcraft.jsch.ChannelSftp.LsEntry> 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.- Parameters:
remoteFileTemplate
- the remote file template.command
- the command.expression
- the filename expression.
-
-
Method Details
-
isDirectory
protected boolean isDirectory(com.jcraft.jsch.ChannelSftp.LsEntry file)- Specified by:
isDirectory
in classorg.springframework.integration.file.remote.gateway.AbstractRemoteFileOutboundGateway<com.jcraft.jsch.ChannelSftp.LsEntry>
-
isLink
protected boolean isLink(com.jcraft.jsch.ChannelSftp.LsEntry file)- Specified by:
isLink
in classorg.springframework.integration.file.remote.gateway.AbstractRemoteFileOutboundGateway<com.jcraft.jsch.ChannelSftp.LsEntry>
-
getFilename
protected java.lang.String getFilename(com.jcraft.jsch.ChannelSftp.LsEntry file)- Specified by:
getFilename
in classorg.springframework.integration.file.remote.gateway.AbstractRemoteFileOutboundGateway<com.jcraft.jsch.ChannelSftp.LsEntry>
-
getFilename
protected java.lang.String getFilename(org.springframework.integration.file.remote.AbstractFileInfo<com.jcraft.jsch.ChannelSftp.LsEntry> file)- Specified by:
getFilename
in classorg.springframework.integration.file.remote.gateway.AbstractRemoteFileOutboundGateway<com.jcraft.jsch.ChannelSftp.LsEntry>
-
asFileInfoList
protected java.util.List<org.springframework.integration.file.remote.AbstractFileInfo<com.jcraft.jsch.ChannelSftp.LsEntry>> asFileInfoList(java.util.Collection<com.jcraft.jsch.ChannelSftp.LsEntry> files)- Specified by:
asFileInfoList
in classorg.springframework.integration.file.remote.gateway.AbstractRemoteFileOutboundGateway<com.jcraft.jsch.ChannelSftp.LsEntry>
-
getModified
protected long getModified(com.jcraft.jsch.ChannelSftp.LsEntry file)- Specified by:
getModified
in classorg.springframework.integration.file.remote.gateway.AbstractRemoteFileOutboundGateway<com.jcraft.jsch.ChannelSftp.LsEntry>
-
enhanceNameWithSubDirectory
protected com.jcraft.jsch.ChannelSftp.LsEntry enhanceNameWithSubDirectory(com.jcraft.jsch.ChannelSftp.LsEntry file, java.lang.String directory)- Specified by:
enhanceNameWithSubDirectory
in classorg.springframework.integration.file.remote.gateway.AbstractRemoteFileOutboundGateway<com.jcraft.jsch.ChannelSftp.LsEntry>
-
getComponentType
public java.lang.String getComponentType()- Specified by:
getComponentType
in interfaceorg.springframework.integration.support.context.NamedComponent
- Overrides:
getComponentType
in classorg.springframework.integration.handler.MessageHandlerSupport
-
isChmodCapable
public boolean isChmodCapable()- Overrides:
isChmodCapable
in classorg.springframework.integration.file.remote.gateway.AbstractRemoteFileOutboundGateway<com.jcraft.jsch.ChannelSftp.LsEntry>
-
doChmod
protected void doChmod(org.springframework.integration.file.remote.RemoteFileOperations<com.jcraft.jsch.ChannelSftp.LsEntry> remoteFileOperations, java.lang.String path, int chmod)- Overrides:
doChmod
in classorg.springframework.integration.file.remote.gateway.AbstractRemoteFileOutboundGateway<com.jcraft.jsch.ChannelSftp.LsEntry>
-