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 target FileTransferringMessageHandlerSpec implementation type.
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<FileTransferringMessageHandler<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 FileTransferringMessageHandlerSpec<F,​S extends FileTransferringMessageHandlerSpec<F,​S>>
extends org.springframework.integration.dsl.MessageHandlerSpec<S,​FileTransferringMessageHandler<F>>
implements org.springframework.integration.dsl.ComponentsRegistration
The MessageHandlerSpec for the FileTransferringMessageHandler.
Since:
5.0
  • Field Summary

    Fields inherited from class org.springframework.integration.dsl.IntegrationComponentSpec

    PARSER, target

    Fields inherited from class org.springframework.beans.factory.config.AbstractFactoryBean

    logger

    Fields inherited from interface org.springframework.beans.factory.FactoryBean

    OBJECT_TYPE_ATTRIBUTE

    Fields inherited from interface org.springframework.context.SmartLifecycle

    DEFAULT_PHASE
  • 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)
    A boolean flag to indicate automatically create the directory or not.
    S charset​(java.lang.String charset)
    Set the charset to use when converting String payloads to bytes as the content of the remote file.
    S charset​(java.nio.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​(java.lang.String fileNameGeneratorExpression)
    Set the DefaultFileNameGenerator 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.
    java.util.Map<java.lang.Object,​java.lang.String> getComponentsToRegister()  
    S remoteDirectory​(java.lang.String remoteDirectory)
    Specify a remote directory path.
    <P> S remoteDirectory​(java.util.function.Function<org.springframework.messaging.Message<P>,​java.lang.String> remoteDirectoryFunction)
    Specify a remote directory path Function.
    S remoteDirectoryExpression​(java.lang.String remoteDirectoryExpression)
    Specify a remote directory path SpEL expression.
    S remoteFileSeparator​(java.lang.String remoteFileSeparator)
    Specify a remote file separator symbol.
    S temporaryFileSuffix​(java.lang.String temporaryFileSuffix)
    Set the temporary suffix to use when transferring files to the remote system.
    S temporaryRemoteDirectory​(java.lang.String temporaryRemoteDirectory)
    Specify a remote directory path.
    <P> S temporaryRemoteDirectory​(java.util.function.Function<org.springframework.messaging.Message<P>,​java.lang.String> temporaryRemoteDirectoryFunction)
    Specify a remote temporary directory path Function.
    S temporaryRemoteDirectoryExpression​(java.lang.String temporaryRemoteDirectoryExpression)
    Specify a remote directory path SpEL expression.
    S useTemporaryFileName​(boolean useTemporaryFileName)
    A boolean 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • 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​(java.lang.String remoteFileSeparator)
      Specify a remote file separator symbol.
      Parameters:
      remoteFileSeparator - the remote file separator.
      Returns:
      the current Spec
    • remoteDirectory

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

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

      public <P> S remoteDirectory​(java.util.function.Function<org.springframework.messaging.Message<P>,​java.lang.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​(java.lang.String temporaryRemoteDirectory)
      Specify a remote directory path.
      Parameters:
      temporaryRemoteDirectory - the temporary remote directory path
      Returns:
      the current Spec
    • temporaryRemoteDirectoryExpression

      public S temporaryRemoteDirectoryExpression​(java.lang.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​(java.util.function.Function<org.springframework.messaging.Message<P>,​java.lang.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​(java.lang.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​(java.lang.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​(java.nio.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​(java.lang.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 java.util.Map<java.lang.Object,​java.lang.String> getComponentsToRegister()
      Specified by:
      getComponentsToRegister in interface org.springframework.integration.dsl.ComponentsRegistration