Class RemoteFileOutboundGatewaySpec<F,S extends RemoteFileOutboundGatewaySpec<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,AbstractRemoteFileOutboundGateway<F>>
org.springframework.integration.file.dsl.RemoteFileOutboundGatewaySpec<F,S>
- Type Parameters:
F
- the target file type.S
- the targetRemoteFileOutboundGatewaySpec
implementation type.
- All Implemented Interfaces:
Aware
,BeanClassLoaderAware
,BeanFactoryAware
,DisposableBean
,FactoryBean<AbstractRemoteFileOutboundGateway<F>>
,InitializingBean
,Lifecycle
,Phased
,SmartLifecycle
,ComponentsRegistration
- Direct Known Subclasses:
FtpOutboundGatewaySpec
,SftpOutboundGatewaySpec
public abstract class RemoteFileOutboundGatewaySpec<F,S extends RemoteFileOutboundGatewaySpec<F,S>> extends MessageHandlerSpec<S,AbstractRemoteFileOutboundGateway<F>> implements ComponentsRegistration
The
MessageHandlerSpec
for the AbstractRemoteFileOutboundGateway
.- Since:
- 5.0
- Author:
- Artem Bilan, Gary Russell
-
Field Summary
Fields inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
PARSER, target
-
Constructor Summary
Constructors Modifier Constructor Description protected
RemoteFileOutboundGatewaySpec(AbstractRemoteFileOutboundGateway<F> outboundGateway)
-
Method Summary
Modifier and Type Method Description S
autoCreateDirectory(boolean autoCreateDirectory)
Determine whether the remote directory should automatically be created when sending files to the remote system.S
autoCreateLocalDirectory(boolean autoCreateLocalDirectory)
Aboolean
flag to identify if local directory should be created automatically.S
charset(String 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
fileExistsMode(FileExistsMode fileExistsMode)
Determine the action to take when using GET and MGET operations when the file already exists locally, or PUT and MPUT when the file exists on the remote system.S
fileNameExpression(String fileNameExpression)
Set the file name expression to determine the full path to the remote file.S
fileNameExpression(Expression fileNameExpression)
Set the file name expression to determine the full path to the remote file.<P> S
fileNameFunction(Function<Message<P>,String> fileNameFunction)
Set the file name function to determine the full path to the remote file.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.S
filter(FileListFilter<F> filter)
Set aFileListFilter
to filter remote files.S
filterExpression(String expression)
Configure theExpressionFileListFilter
.S
filterFunction(Function<F,Boolean> filterFunction)
Configure theExpressionFileListFilter
.Map<Object,String>
getComponentsToRegister()
S
localDirectory(File localDirectory)
Specify a directory path where remote files will be transferred to.<P> S
localDirectory(Function<Message<P>,String> localDirectoryFunction)
Specify aFunction
to evaluate directory path where remote files will be transferred to.S
localDirectoryExpression(String localDirectoryExpression)
Specify a SpEL expression to evaluate directory path where remote files will be transferred to.S
localDirectoryExpression(Expression localDirectoryExpression)
Specify a SpEL expression to evaluate directory path where remote files will be transferred to.S
localFilenameExpression(String localFilenameExpression)
Specify a SpEL expression for local files renaming after downloading.S
localFilenameExpression(Expression localFilenameExpression)
Specify a SpEL expression for local files renaming after downloading.<P> S
localFilenameFunction(Function<Message<P>,String> localFilenameFunction)
Specify aFunction
for local files renaming after downloading.S
mputFilter(FileListFilter<File> filter)
AFileListFilter
that runs against the local file system view when usingMPUT
command.S
mputFilterExpression(String expression)
Configure theExpressionFileListFilter
.S
mputFilterFunction(Function<File,Boolean> filterFunction)
Configure theExpressionFileListFilter
.S
options(String options)
Specify the array of options for various gateway commands.S
options(AbstractRemoteFileOutboundGateway.Option... options)
Specify the array ofAbstractRemoteFileOutboundGateway.Option
for various gateway commands.abstract S
patternFileNameFilter(String pattern)
Specify a simple pattern to match remote files (e.g.S
patternMputFilter(String pattern)
ASimplePatternFileListFilter
that runs against the local file system view when usingMPUT
command.abstract S
regexFileNameFilter(String regex)
Specify a simple pattern to match remote files (e.g.S
regexMputFilter(String regex)
ASimplePatternFileListFilter
that runs against the local file system view when usingMPUT
command.S
remoteDirectoryExpression(String remoteDirectoryExpression)
Set the remote directory expression used to determine the remote directory to which files will be sent.S
remoteDirectoryExpression(Expression remoteDirectoryExpression)
Set the remote directory expression used to determine the remote directory to which files will be sent.<P> S
remoteDirectoryFunction(Function<Message<P>,String> remoteDirectoryFunction)
Specify aFunction
for remote directory.S
remoteFileSeparator(String remoteFileSeparator)
Set the file separator when dealing with remote files; default '/'.S
renameExpression(String expression)
Specify a SpEL expression for files renaming during transfer.S
renameExpression(Expression expression)
Specify a SpEL expression for files renaming during transfer.<P> S
renameFunction(Function<Message<P>,String> renameFunction)
Specify aFunction
for files renaming during transfer.S
temporaryFileSuffix(String temporaryFileSuffix)
Set the temporary suffix to use when transferring files to the remote system.S
temporaryRemoteDirectoryExpression(String temporaryRemoteDirectoryExpression)
Set a temporary remote directory expression; used when transferring files to the remote system.S
temporaryRemoteDirectoryExpression(Expression temporaryRemoteDirectoryExpression)
Set a temporary remote directory expression; used when transferring files to the remote system.<P> S
temporaryRemoteDirectoryFunction(Function<Message<P>,String> temporaryRemoteDirectoryFunction)
Set a temporary remote directory function; used when transferring files to the remote system.S
useTemporaryFileName(boolean useTemporaryFileName)
Set whether a temporary file name is used when sending files to the remote system.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
-
Method Details
-
options
Specify the array of options for various gateway commands.- Parameters:
options
- the options to set.- Returns:
- the spec
- See Also:
options(AbstractRemoteFileOutboundGateway.Option...)
-
options
Specify the array ofAbstractRemoteFileOutboundGateway.Option
for various gateway commands.- Parameters:
options
- the options to set.- Returns:
- the spec
-
remoteFileSeparator
Set the file separator when dealing with remote files; default '/'.- Parameters:
remoteFileSeparator
- the separator.- Returns:
- the spec
-
localDirectory
Specify a directory path where remote files will be transferred to.- Parameters:
localDirectory
- the localDirectory to set- Returns:
- the spec
-
localDirectoryExpression
Specify a SpEL expression to evaluate directory path where remote files will be transferred to.- Parameters:
localDirectoryExpression
- the SpEL to determine the local directory.- Returns:
- the spec
-
localDirectory
Specify aFunction
to evaluate directory path where remote files will be transferred to.- Type Parameters:
P
- the expected payload type.- Parameters:
localDirectoryFunction
- theFunction
to determine the local directory.- Returns:
- the spec
-
localDirectoryExpression
Specify a SpEL expression to evaluate directory path where remote files will be transferred to.- Parameters:
localDirectoryExpression
- a SpEL expression to evaluate the local directory.- Returns:
- the Spec.
-
autoCreateLocalDirectory
Aboolean
flag to identify if local directory should be created automatically. Defaults totrue
.- Parameters:
autoCreateLocalDirectory
- the autoCreateLocalDirectory to set- Returns:
- the Spec.
-
temporaryFileSuffix
Set the temporary suffix to use when transferring files to the remote system. Default.writing
.- Parameters:
temporaryFileSuffix
- the temporaryFileSuffix to set- Returns:
- the Spec.
-
filter
Set aFileListFilter
to filter remote files.- Parameters:
filter
- the filter to set- Returns:
- the Spec.
-
filterExpression
Configure theExpressionFileListFilter
.- Parameters:
expression
- the SpEL expression for files filtering.- Returns:
- the spec.
- See Also:
AbstractRemoteFileOutboundGateway.setFilter(FileListFilter)
,ExpressionFileListFilter
-
filterFunction
Configure theExpressionFileListFilter
.- Parameters:
filterFunction
- theFunction
for files filtering.- Returns:
- the spec.
- See Also:
AbstractRemoteFileOutboundGateway.setFilter(FileListFilter)
,ExpressionFileListFilter
-
mputFilter
AFileListFilter
that runs against the local file system view when usingMPUT
command.- Parameters:
filter
- the filter to set- Returns:
- the Spec.
-
patternMputFilter
ASimplePatternFileListFilter
that runs against the local file system view when usingMPUT
command.- Parameters:
pattern
- theSimplePatternFileListFilter
forMPUT
command.- Returns:
- the Spec.
-
regexMputFilter
ASimplePatternFileListFilter
that runs against the local file system view when usingMPUT
command.- Parameters:
regex
- theSimplePatternFileListFilter
forMPUT
command.- Returns:
- the Spec.
-
mputFilterExpression
Configure theExpressionFileListFilter
.- Parameters:
expression
- the SpEL expression for files filtering.- Returns:
- the spec.
- See Also:
AbstractRemoteFileOutboundGateway.setFilter(FileListFilter)
,ExpressionFileListFilter
-
mputFilterFunction
Configure theExpressionFileListFilter
.- Parameters:
filterFunction
- theFunction
for files filtering.- Returns:
- the spec.
- See Also:
AbstractRemoteFileOutboundGateway.setFilter(FileListFilter)
,ExpressionFileListFilter
-
renameExpression
Specify a SpEL expression for files renaming during transfer.- Parameters:
expression
- the String in SpEL syntax.- Returns:
- the Spec.
-
renameExpression
Specify a SpEL expression for files renaming during transfer.- Parameters:
expression
- the String in SpEL syntax.- Returns:
- the Spec.
-
renameFunction
Specify aFunction
for files renaming during transfer.- Type Parameters:
P
- the expected payload type.- Parameters:
renameFunction
- theFunction
to use.- Returns:
- the Spec.
-
localFilenameExpression
Specify a SpEL expression for local files renaming after downloading.- Parameters:
localFilenameExpression
- the SpEL expression to use.- Returns:
- the Spec.
-
localFilenameFunction
Specify aFunction
for local files renaming after downloading.- Type Parameters:
P
- the expected payload type.- Parameters:
localFilenameFunction
- theFunction
to use.- Returns:
- the Spec.
- Since:
- 5.2
-
localFilenameExpression
Specify a SpEL expression for local files renaming after downloading.- Parameters:
localFilenameExpression
- a SpEL expression to evaluate the local file name.- Returns:
- the Spec.
-
chmod
Set the file permissions after uploading, e.g. 0600 for owner read/write.- Parameters:
chmod
- the permissions.- Returns:
- the current Spec
-
fileExistsMode
Determine the action to take when using GET and MGET operations when the file already exists locally, or PUT and MPUT when the file exists on the remote system.- Parameters:
fileExistsMode
- the fileExistsMode to set.- Returns:
- the current Spec
-
autoCreateDirectory
Determine whether the remote directory should automatically be created when sending files to the remote system.- Parameters:
autoCreateDirectory
- true to create the directory.- Returns:
- the current Spec
- Since:
- 5.2
- See Also:
AbstractRemoteFileOutboundGateway.setAutoCreateDirectory(boolean)
-
remoteDirectoryExpression
Set the remote directory expression used to determine the remote directory to which files will be sent.- Parameters:
remoteDirectoryExpression
- the remote directory expression.- Returns:
- the current Spec
- Since:
- 5.2
- See Also:
AbstractRemoteFileOutboundGateway.setRemoteDirectoryExpression(org.springframework.expression.Expression)
-
remoteDirectoryFunction
Specify aFunction
for remote directory.- Type Parameters:
P
- the expected payload type.- Parameters:
remoteDirectoryFunction
- theFunction
to use.- Returns:
- the Spec.
- Since:
- 5.2
- See Also:
AbstractRemoteFileOutboundGateway.setRemoteDirectoryExpression(org.springframework.expression.Expression)
,FunctionExpression
-
remoteDirectoryExpression
Set the remote directory expression used to determine the remote directory to which files will be sent.- Parameters:
remoteDirectoryExpression
- the remote directory expression.- Returns:
- the current Spec
- Since:
- 5.2
- See Also:
AbstractRemoteFileOutboundGateway.setRemoteDirectoryExpression(org.springframework.expression.Expression)
-
temporaryRemoteDirectoryExpression
Set a temporary remote directory expression; used when transferring files to the remote system.- Parameters:
temporaryRemoteDirectoryExpression
- the temporary remote directory expression.- Returns:
- the current Spec
- Since:
- 5.2
- See Also:
AbstractRemoteFileOutboundGateway.setRemoteDirectoryExpression(org.springframework.expression.Expression)
-
temporaryRemoteDirectoryFunction
public <P> S temporaryRemoteDirectoryFunction(Function<Message<P>,String> temporaryRemoteDirectoryFunction)Set a temporary remote directory function; used when transferring files to the remote system.- Type Parameters:
P
- the expected payload type.- Parameters:
temporaryRemoteDirectoryFunction
- the file name expression.- Returns:
- the current Spec
- Since:
- 5.2
- See Also:
AbstractRemoteFileOutboundGateway.setRemoteDirectoryExpression(org.springframework.expression.Expression)
-
temporaryRemoteDirectoryExpression
Set a temporary remote directory expression; used when transferring files to the remote system.- Parameters:
temporaryRemoteDirectoryExpression
- the temporary remote directory expression.- Returns:
- the current Spec
- Since:
- 5.2
- See Also:
AbstractRemoteFileOutboundGateway.setRemoteDirectoryExpression(org.springframework.expression.Expression)
-
fileNameExpression
Set the file name expression to determine the full path to the remote file.- Parameters:
fileNameExpression
- the file name expression.- Returns:
- the current Spec
- Since:
- 5.2
- See Also:
AbstractRemoteFileOutboundGateway.setFileNameExpression(org.springframework.expression.Expression)
-
fileNameFunction
Set the file name function to determine the full path to the remote file.- Type Parameters:
P
- the expected payload type.- Parameters:
fileNameFunction
- the file name expression.- Returns:
- the current Spec
- Since:
- 5.2
- See Also:
AbstractRemoteFileOutboundGateway.setFileNameExpression(org.springframework.expression.Expression)
-
fileNameExpression
Set the file name expression to determine the full path to the remote file.- Parameters:
fileNameExpression
- the file name expression.- Returns:
- the current Spec
- Since:
- 5.2
- See Also:
AbstractRemoteFileOutboundGateway.setFileNameExpression(org.springframework.expression.Expression)
-
useTemporaryFileName
Set whether a temporary file name is used when sending files to the remote system.- Parameters:
useTemporaryFileName
- true to use a temporary file name.- Returns:
- the current Spec
- Since:
- 5.2
- See Also:
AbstractRemoteFileOutboundGateway.setUseTemporaryFileName(boolean)
-
fileNameGenerator
Set the file name generator used to generate the remote filename to be used when transferring files to the remote system.- Parameters:
fileNameGenerator
- the file name generator.- Returns:
- the current Spec
- Since:
- 5.2
- See Also:
AbstractRemoteFileOutboundGateway.setFileNameGenerator(org.springframework.integration.file.FileNameGenerator)
-
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
- Since:
- 5.2
- See Also:
AbstractRemoteFileOutboundGateway.setCharset(java.lang.String)
-
getComponentsToRegister
- Specified by:
getComponentsToRegister
in interfaceComponentsRegistration
-
patternFileNameFilter
Specify a simple pattern to match remote files (e.g. '*.txt').- Parameters:
pattern
- the pattern.- Returns:
- the spec.
- See Also:
AbstractSimplePatternFileListFilter
,filter(org.springframework.integration.file.filters.FileListFilter)
-
regexFileNameFilter
Specify a simple pattern to match remote files (e.g. '[0-9].*.txt').- Parameters:
regex
- the regex pattern.- Returns:
- the spec.
- See Also:
AbstractRegexPatternFileListFilter
,filter(org.springframework.integration.file.filters.FileListFilter)
-