Class RemoteFileOutboundGatewaySpec<F,S extends RemoteFileOutboundGatewaySpec<F,S>>
java.lang.Object
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:
DisposableBean
,FactoryBean<AbstractRemoteFileOutboundGateway<F>>
,InitializingBean
,Lifecycle
,Phased
,SmartLifecycle
,ComponentsRegistration
- Direct Known Subclasses:
FtpOutboundGatewaySpec
,SftpOutboundGatewaySpec
,SmbOutboundGatewaySpec
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
logger, PARSER, target
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE
Fields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE
-
Constructor Summary
ModifierConstructorDescriptionprotected
RemoteFileOutboundGatewaySpec
(AbstractRemoteFileOutboundGateway<F> outboundGateway) -
Method Summary
Modifier and TypeMethodDescriptionautoCreateDirectory
(boolean autoCreateDirectory) Determine whether the remote directory should automatically be created when sending files to the remote system.autoCreateLocalDirectory
(boolean autoCreateLocalDirectory) Aboolean
flag to identify if local directory should be created automatically.Set the charset to use when converting String payloads to bytes as the content of the remote file.chmod
(int chmod) Set the file permissions after uploading, e.g.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.fileNameExpression
(String fileNameExpression) Set the file name expression to determine the full path to the remote file.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.fileNameGenerator
(FileNameGenerator fileNameGenerator) Set the file name generator used to generate the remote filename to be used when transferring files to the remote system.filter
(FileListFilter<F> filter) Set aFileListFilter
to filter remote files.filterExpression
(String expression) Configure theExpressionFileListFilter
.filterFunction
(Function<F, Boolean> filterFunction) Configure theExpressionFileListFilter
.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.localDirectoryExpression
(String localDirectoryExpression) Specify a SpEL expression to evaluate directory path where remote files will be transferred to.localDirectoryExpression
(Expression localDirectoryExpression) Specify a SpEL expression to evaluate directory path where remote files will be transferred to.localFilenameExpression
(String localFilenameExpression) Specify a SpEL expression for local files renaming after downloading.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.mputFilter
(FileListFilter<File> filter) AFileListFilter
that runs against the local file system view when usingMPUT
command.mputFilterExpression
(String expression) Configure theExpressionFileListFilter
.mputFilterFunction
(Function<File, Boolean> filterFunction) Configure theExpressionFileListFilter
.Specify the array of options for various gateway commands.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.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.regexMputFilter
(String regex) ASimplePatternFileListFilter
that runs against the local file system view when usingMPUT
command.remoteDirectoryExpression
(String remoteDirectoryExpression) Set the remote directory expression used to determine the remote directory to which files will be sent.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.remoteFileSeparator
(String remoteFileSeparator) Set the file separator when dealing with remote files; default '/'.renameExpression
(String expression) Specify a SpEL expression for files renaming during transfer.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.temporaryFileSuffix
(String temporaryFileSuffix) Set the temporary suffix to use when transferring files to the remote system.temporaryRemoteDirectoryExpression
(String temporaryRemoteDirectoryExpression) Set a temporary remote directory expression; used when transferring files to the remote system.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.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, afterPropertiesSet, destroy, doGet, getId, getObject, getObjectType, getPhase, id, isAutoStartup, isRunning, start, stop, stop
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.FactoryBean
isSingleton
-
Constructor Details
-
RemoteFileOutboundGatewaySpec
-
-
Method Details
-
options
Specify the array of options for various gateway commands.- Parameters:
options
- the options to set.- Returns:
- the spec
- See Also:
-
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:
-
filterFunction
Configure theExpressionFileListFilter
.- Parameters:
filterFunction
- theFunction
for files filtering.- Returns:
- the spec.
- See Also:
-
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:
-
mputFilterFunction
Configure theExpressionFileListFilter
.- Parameters:
filterFunction
- theFunction
for files filtering.- Returns:
- the spec.
- See Also:
-
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:
-
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:
-
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:
-
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:
-
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:
-
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:
-
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:
-
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:
-
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:
-
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:
-
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:
-
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:
-
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:
-
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:
-
regexFileNameFilter
Specify a simple pattern to match remote files (e.g. '[0-9].*.txt').- Parameters:
regex
- the regex pattern.- Returns:
- the spec.
- See Also:
-