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 target RemoteFileOutboundGatewaySpec implementation type.
All Implemented Interfaces:
org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<AbstractRemoteFileOutboundGateway<F>>, org.springframework.beans.factory.InitializingBean, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle, org.springframework.integration.dsl.ComponentsRegistration

public abstract class RemoteFileOutboundGatewaySpec<F,S extends RemoteFileOutboundGatewaySpec<F,S>> extends org.springframework.integration.dsl.MessageHandlerSpec<S,AbstractRemoteFileOutboundGateway<F>> implements org.springframework.integration.dsl.ComponentsRegistration
The MessageHandlerSpec for the AbstractRemoteFileOutboundGateway.
Since:
5.0
  • Constructor Details

  • Method Details

    • options

      public S options(String options)
      Specify the array of options for various gateway commands.
      Parameters:
      options - the options to set.
      Returns:
      the spec
      See Also:
    • options

      public S options(AbstractRemoteFileOutboundGateway.Option... options)
      Specify the array of AbstractRemoteFileOutboundGateway.Option for various gateway commands.
      Parameters:
      options - the options to set.
      Returns:
      the spec
    • remoteFileSeparator

      public S remoteFileSeparator(String remoteFileSeparator)
      Set the file separator when dealing with remote files; default '/'.
      Parameters:
      remoteFileSeparator - the separator.
      Returns:
      the spec
    • localDirectory

      public S localDirectory(File localDirectory)
      Specify a directory path where remote files will be transferred to.
      Parameters:
      localDirectory - the localDirectory to set
      Returns:
      the spec
    • localDirectoryExpression

      public S localDirectoryExpression(String 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

      public <P> S localDirectory(Function<org.springframework.messaging.Message<P>,String> localDirectoryFunction)
      Specify a Function to evaluate directory path where remote files will be transferred to.
      Type Parameters:
      P - the expected payload type.
      Parameters:
      localDirectoryFunction - the Function to determine the local directory.
      Returns:
      the spec
    • localDirectoryExpression

      public S localDirectoryExpression(org.springframework.expression.Expression 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

      public S autoCreateLocalDirectory(boolean autoCreateLocalDirectory)
      A boolean flag to identify if local directory should be created automatically. Defaults to true.
      Parameters:
      autoCreateLocalDirectory - the autoCreateLocalDirectory to set
      Returns:
      the Spec.
    • temporaryFileSuffix

      public S temporaryFileSuffix(String 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

      public S filter(FileListFilter<F> filter)
      Set a FileListFilter to filter remote files.
      Parameters:
      filter - the filter to set
      Returns:
      the Spec.
    • filterExpression

      public S filterExpression(String expression)
      Parameters:
      expression - the SpEL expression for files filtering.
      Returns:
      the spec.
      See Also:
    • filterFunction

      public S filterFunction(Function<F,Boolean> filterFunction)
      Parameters:
      filterFunction - the Function for files filtering.
      Returns:
      the spec.
      See Also:
    • mputFilter

      public S mputFilter(FileListFilter<File> filter)
      A FileListFilter that runs against the local file system view when using MPUT command.
      Parameters:
      filter - the filter to set
      Returns:
      the Spec.
    • patternMputFilter

      public S patternMputFilter(String pattern)
      A SimplePatternFileListFilter that runs against the local file system view when using MPUT command.
      Parameters:
      pattern - the SimplePatternFileListFilter for MPUT command.
      Returns:
      the Spec.
    • regexMputFilter

      public S regexMputFilter(String regex)
      A SimplePatternFileListFilter that runs against the local file system view when using MPUT command.
      Parameters:
      regex - the SimplePatternFileListFilter for MPUT command.
      Returns:
      the Spec.
    • mputFilterExpression

      public S mputFilterExpression(String expression)
      Parameters:
      expression - the SpEL expression for files filtering.
      Returns:
      the spec.
      See Also:
    • mputFilterFunction

      public S mputFilterFunction(Function<File,Boolean> filterFunction)
      Parameters:
      filterFunction - the Function for files filtering.
      Returns:
      the spec.
      See Also:
    • renameExpression

      public S renameExpression(String expression)
      Specify a SpEL expression for files renaming during transfer.
      Parameters:
      expression - the String in SpEL syntax.
      Returns:
      the Spec.
    • renameExpression

      public S renameExpression(org.springframework.expression.Expression expression)
      Specify a SpEL expression for files renaming during transfer.
      Parameters:
      expression - the String in SpEL syntax.
      Returns:
      the Spec.
    • renameFunction

      public <P> S renameFunction(Function<org.springframework.messaging.Message<P>,String> renameFunction)
      Specify a Function for files renaming during transfer.
      Type Parameters:
      P - the expected payload type.
      Parameters:
      renameFunction - the Function to use.
      Returns:
      the Spec.
    • localFilenameExpression

      public S localFilenameExpression(String localFilenameExpression)
      Specify a SpEL expression for local files renaming after downloading.
      Parameters:
      localFilenameExpression - the SpEL expression to use.
      Returns:
      the Spec.
    • localFilenameFunction

      public <P> S localFilenameFunction(Function<org.springframework.messaging.Message<P>,String> localFilenameFunction)
      Specify a Function for local files renaming after downloading.
      Type Parameters:
      P - the expected payload type.
      Parameters:
      localFilenameFunction - the Function to use.
      Returns:
      the Spec.
      Since:
      5.2
    • localFilenameExpression

      public S localFilenameExpression(org.springframework.expression.Expression 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

      public S chmod(int chmod)
      Set the file permissions after uploading, e.g. 0600 for owner read/write.
      Parameters:
      chmod - the permissions.
      Returns:
      the current Spec
    • fileExistsMode

      public 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.
      Parameters:
      fileExistsMode - the fileExistsMode to set.
      Returns:
      the current Spec
    • autoCreateDirectory

      public S autoCreateDirectory(boolean 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

      public S remoteDirectoryExpression(String 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

      public <P> S remoteDirectoryFunction(Function<org.springframework.messaging.Message<P>,String> remoteDirectoryFunction)
      Specify a Function for remote directory.
      Type Parameters:
      P - the expected payload type.
      Parameters:
      remoteDirectoryFunction - the Function to use.
      Returns:
      the Spec.
      Since:
      5.2
      See Also:
    • remoteDirectoryExpression

      public S remoteDirectoryExpression(org.springframework.expression.Expression 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

      public S temporaryRemoteDirectoryExpression(String 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<org.springframework.messaging.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

      public S temporaryRemoteDirectoryExpression(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:
    • fileNameExpression

      public S fileNameExpression(String 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

      public <P> S fileNameFunction(Function<org.springframework.messaging.Message<P>,String> 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

      public S fileNameExpression(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:
    • useTemporaryFileName

      public S useTemporaryFileName(boolean 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

      public 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.
      Parameters:
      fileNameGenerator - the file name generator.
      Returns:
      the current Spec
      Since:
      5.2
      See Also:
    • charset

      public S charset(String charset)
      Set the charset to use when converting String payloads to bytes as the content of the remote file. Default UTF-8.
      Parameters:
      charset - the charset.
      Returns:
      the current Spec
      Since:
      5.2
      See Also:
    • getComponentsToRegister

      public Map<Object,String> getComponentsToRegister()
      Specified by:
      getComponentsToRegister in interface org.springframework.integration.dsl.ComponentsRegistration
    • patternFileNameFilter

      public abstract S patternFileNameFilter(String pattern)
      Specify a simple pattern to match remote files (e.g. '*.txt').
      Parameters:
      pattern - the pattern.
      Returns:
      the spec.
      See Also:
    • regexFileNameFilter

      public abstract S regexFileNameFilter(String regex)
      Specify a simple pattern to match remote files (e.g. '[0-9].*.txt').
      Parameters:
      regex - the regex pattern.
      Returns:
      the spec.
      See Also: