Class FileTransferringMessageHandlerSpec<F,S extends FileTransferringMessageHandlerSpec<F,S>>
java.lang.Object
org.springframework.beans.factory.config.AbstractFactoryBean<T>
org.springframework.integration.dsl.IntegrationComponentSpec<S,H>
org.springframework.integration.dsl.MessageHandlerSpec<S,FileTransferringMessageHandler<F>>
org.springframework.integration.file.dsl.FileTransferringMessageHandlerSpec<F,S>
- Type Parameters:
F
- the target file type.S
- the targetFileTransferringMessageHandlerSpec
implementation type.
- All Implemented Interfaces:
Aware
,BeanClassLoaderAware
,BeanFactoryAware
,DisposableBean
,FactoryBean<FileTransferringMessageHandler<F>>
,InitializingBean
,Lifecycle
,Phased
,SmartLifecycle
,ComponentsRegistration
- Direct Known Subclasses:
FtpMessageHandlerSpec
,SftpMessageHandlerSpec
public abstract class FileTransferringMessageHandlerSpec<F,S extends FileTransferringMessageHandlerSpec<F,S>> extends MessageHandlerSpec<S,FileTransferringMessageHandler<F>> implements ComponentsRegistration
The
MessageHandlerSpec
for the FileTransferringMessageHandler
.- Since:
- 5.0
- Author:
- Artem Bilan, Joaquin Santana
-
Field Summary
Fields inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
PARSER, target
-
Constructor Summary
Constructors Modifier Constructor Description protected
FileTransferringMessageHandlerSpec()
protected
FileTransferringMessageHandlerSpec(RemoteFileTemplate<F> remoteFileTemplate)
protected
FileTransferringMessageHandlerSpec(RemoteFileTemplate<F> remoteFileTemplate, FileExistsMode fileExistsMode)
protected
FileTransferringMessageHandlerSpec(SessionFactory<F> sessionFactory)
-
Method Summary
Modifier and Type Method Description S
autoCreateDirectory(boolean autoCreateDirectory)
Aboolean
flag to indicate automatically create the directory or not.S
charset(String charset)
Set the charset to use when converting String payloads to bytes as the content of the remote file.S
charset(Charset charset)
Set the charset to use when converting String payloads to bytes as the content of the remote file.S
chmod(int chmod)
Set the file permissions after uploading, e.g.S
fileNameExpression(String fileNameGeneratorExpression)
Set theDefaultFileNameGenerator
based on the provided SpEL expression.S
fileNameGenerator(FileNameGenerator fileNameGenerator)
Set the file name generator used to generate the remote filename to be used when transferring files to the remote system.Map<Object,String>
getComponentsToRegister()
S
remoteDirectory(String remoteDirectory)
Specify a remote directory path.<P> S
remoteDirectory(Function<Message<P>,String> remoteDirectoryFunction)
Specify a remote directory pathFunction
.S
remoteDirectoryExpression(String remoteDirectoryExpression)
Specify a remote directory path SpEL expression.S
remoteFileSeparator(String remoteFileSeparator)
Specify a remote file separator symbol.S
temporaryFileSuffix(String temporaryFileSuffix)
Set the temporary suffix to use when transferring files to the remote system.S
temporaryRemoteDirectory(String temporaryRemoteDirectory)
Specify a remote directory path.<P> S
temporaryRemoteDirectory(Function<Message<P>,String> temporaryRemoteDirectoryFunction)
Specify a remote temporary directory pathFunction
.S
temporaryRemoteDirectoryExpression(String temporaryRemoteDirectoryExpression)
Specify a remote directory path SpEL expression.S
useTemporaryFileName(boolean useTemporaryFileName)
Aboolean
flag to use temporary files names or not.Methods inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
_this, createInstance, destroyInstance, doGet, get, getId, getObjectType, getPhase, id, isAutoStartup, isRunning, start, stop, stop
Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
afterPropertiesSet, destroy, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton
-
Constructor Details
-
FileTransferringMessageHandlerSpec
protected FileTransferringMessageHandlerSpec() -
FileTransferringMessageHandlerSpec
-
FileTransferringMessageHandlerSpec
-
FileTransferringMessageHandlerSpec
protected FileTransferringMessageHandlerSpec(RemoteFileTemplate<F> remoteFileTemplate, FileExistsMode fileExistsMode)
-
-
Method Details
-
autoCreateDirectory
Aboolean
flag to indicate automatically create the directory or not.- Parameters:
autoCreateDirectory
- true to automatically create the directory.- Returns:
- the current Spec
-
remoteFileSeparator
Specify a remote file separator symbol.- Parameters:
remoteFileSeparator
- the remote file separator.- Returns:
- the current Spec
-
remoteDirectory
Specify a remote directory path.- Parameters:
remoteDirectory
- the remote directory path.- Returns:
- the current Spec
-
remoteDirectoryExpression
Specify a remote directory path SpEL expression.- Parameters:
remoteDirectoryExpression
- the remote directory expression- Returns:
- the current Spec
-
remoteDirectory
Specify a remote directory pathFunction
.- Type Parameters:
P
- the expected payload type.- Parameters:
remoteDirectoryFunction
- the remote directoryFunction
- Returns:
- the current Spec
-
temporaryRemoteDirectory
Specify a remote directory path.- Parameters:
temporaryRemoteDirectory
- the temporary remote directory path- Returns:
- the current Spec
-
temporaryRemoteDirectoryExpression
Specify a remote directory path SpEL expression.- Parameters:
temporaryRemoteDirectoryExpression
- the temporary remote directory path SpEL expression- Returns:
- the current Spec
-
temporaryRemoteDirectory
public <P> S temporaryRemoteDirectory(Function<Message<P>,String> temporaryRemoteDirectoryFunction)Specify a remote temporary directory pathFunction
.- Type Parameters:
P
- the expected payload type.- Parameters:
temporaryRemoteDirectoryFunction
- the temporary remote directoryFunction
- Returns:
- the current Spec
-
useTemporaryFileName
Aboolean
flag to use temporary files names or not. Defaults totrue
.- Parameters:
useTemporaryFileName
- true to use a temporary file name.- Returns:
- the current Spec
-
fileNameGenerator
Set the file name generator used to generate the remote filename to be used when transferring files to the remote system. DefaultDefaultFileNameGenerator
.- Parameters:
fileNameGenerator
- the file name generator.- Returns:
- the current Spec
-
fileNameExpression
Set theDefaultFileNameGenerator
based on the provided SpEL expression.- Parameters:
fileNameGeneratorExpression
- the SpEL expression for file names generation.- Returns:
- the current Spec
-
charset
Set the charset to use when converting String payloads to bytes as the content of the remote file. DefaultUTF-8
.- Parameters:
charset
- the charset.- Returns:
- the current Spec
-
charset
Set the charset to use when converting String payloads to bytes as the content of the remote file. DefaultUTF-8
.- Parameters:
charset
- the charset.- Returns:
- the current Spec
-
temporaryFileSuffix
Set the temporary suffix to use when transferring files to the remote system. Default ".writing".- Parameters:
temporaryFileSuffix
- the suffix- Returns:
- the current Spec
-
chmod
Set the file permissions after uploading, e.g. 0600 for owner read/write.- Parameters:
chmod
- the permissions.- Returns:
- the current Spec
-
getComponentsToRegister
- Specified by:
getComponentsToRegister
in interfaceComponentsRegistration
-