Class FileTransferringMessageHandlerSpec<F,S extends FileTransferringMessageHandlerSpec<F,S>>

Type Parameters:
F - the target file type.
S - the target FileTransferringMessageHandlerSpec 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
Since:
5.0
Author:
Artem Bilan, Joaquin Santana
  • Constructor Details

    • FileTransferringMessageHandlerSpec

      protected FileTransferringMessageHandlerSpec()
    • FileTransferringMessageHandlerSpec

      protected FileTransferringMessageHandlerSpec(SessionFactory<F> sessionFactory)
    • FileTransferringMessageHandlerSpec

      protected FileTransferringMessageHandlerSpec(RemoteFileTemplate<F> remoteFileTemplate)
    • FileTransferringMessageHandlerSpec

      protected FileTransferringMessageHandlerSpec(RemoteFileTemplate<F> remoteFileTemplate, FileExistsMode fileExistsMode)
  • Method Details

    • autoCreateDirectory

      public S autoCreateDirectory(boolean autoCreateDirectory)
      A boolean flag to indicate automatically create the directory or not.
      Parameters:
      autoCreateDirectory - true to automatically create the directory.
      Returns:
      the current Spec
    • remoteFileSeparator

      public S remoteFileSeparator(String remoteFileSeparator)
      Specify a remote file separator symbol.
      Parameters:
      remoteFileSeparator - the remote file separator.
      Returns:
      the current Spec
    • remoteDirectory

      public S remoteDirectory(String remoteDirectory)
      Specify a remote directory path.
      Parameters:
      remoteDirectory - the remote directory path.
      Returns:
      the current Spec
    • remoteDirectoryExpression

      public S remoteDirectoryExpression(String remoteDirectoryExpression)
      Specify a remote directory path SpEL expression.
      Parameters:
      remoteDirectoryExpression - the remote directory expression
      Returns:
      the current Spec
    • remoteDirectory

      public <P> S remoteDirectory(Function<Message<P>,String> remoteDirectoryFunction)
      Specify a remote directory path Function.
      Type Parameters:
      P - the expected payload type.
      Parameters:
      remoteDirectoryFunction - the remote directory Function
      Returns:
      the current Spec
    • temporaryRemoteDirectory

      public S temporaryRemoteDirectory(String temporaryRemoteDirectory)
      Specify a remote directory path.
      Parameters:
      temporaryRemoteDirectory - the temporary remote directory path
      Returns:
      the current Spec
    • temporaryRemoteDirectoryExpression

      public S temporaryRemoteDirectoryExpression(String 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 path Function.
      Type Parameters:
      P - the expected payload type.
      Parameters:
      temporaryRemoteDirectoryFunction - the temporary remote directory Function
      Returns:
      the current Spec
    • useTemporaryFileName

      public S useTemporaryFileName(boolean useTemporaryFileName)
      A boolean flag to use temporary files names or not. Defaults to true.
      Parameters:
      useTemporaryFileName - true to use a temporary file name.
      Returns:
      the current Spec
    • 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. Default DefaultFileNameGenerator.
      Parameters:
      fileNameGenerator - the file name generator.
      Returns:
      the current Spec
    • fileNameExpression

      public S fileNameExpression(String fileNameGeneratorExpression)
      Set the DefaultFileNameGenerator based on the provided SpEL expression.
      Parameters:
      fileNameGeneratorExpression - the SpEL expression for file names generation.
      Returns:
      the current Spec
    • 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
    • charset

      public S charset(Charset 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
    • temporaryFileSuffix

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

      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
    • getComponentsToRegister

      public Map<Object,String> getComponentsToRegister()
      Specified by:
      getComponentsToRegister in interface ComponentsRegistration