Class RemoteFileInboundChannelAdapterSpec<F,S extends RemoteFileInboundChannelAdapterSpec<F,S,MS>,MS extends AbstractInboundFileSynchronizingMessageSource<F>>

java.lang.Object
org.springframework.integration.dsl.IntegrationComponentSpec<S,H>
org.springframework.integration.dsl.MessageSourceSpec<S,MS>
org.springframework.integration.file.dsl.RemoteFileInboundChannelAdapterSpec<F,S,MS>
Type Parameters:
F - the target file type.
S - the target RemoteFileInboundChannelAdapterSpec implementation type.
MS - the target AbstractInboundFileSynchronizingMessageSource implementation type.
All Implemented Interfaces:
DisposableBean, FactoryBean<MS>, InitializingBean, Lifecycle, Phased, SmartLifecycle, ComponentsRegistration
Direct Known Subclasses:
FtpInboundChannelAdapterSpec, SftpInboundChannelAdapterSpec, SmbInboundChannelAdapterSpec

public abstract class RemoteFileInboundChannelAdapterSpec<F,S extends RemoteFileInboundChannelAdapterSpec<F,S,MS>,MS extends AbstractInboundFileSynchronizingMessageSource<F>> extends MessageSourceSpec<S,MS> implements ComponentsRegistration
Since:
5.0
Author:
Artem Bilan, Gary Russell
  • Field Details

  • Constructor Details

  • Method Details

    • autoCreateLocalDirectory

      public S autoCreateLocalDirectory(boolean autoCreateLocalDirectory)
      Configure whether the local directory should be created by the adapter.
      Parameters:
      autoCreateLocalDirectory - the autoCreateLocalDirectory
      Returns:
      the spec.
    • localDirectory

      public S localDirectory(File localDirectory)
      Configure the local directory to copy files to.
      Parameters:
      localDirectory - the localDirectory.
      Returns:
      the spec.
    • localFilter

      public S localFilter(FileListFilter<File> localFileListFilter)
      A FileListFilter used to determine which files will generate messages after they have been synchronized.
      Parameters:
      localFileListFilter - the localFileListFilter.
      Returns:
      the spec.
      See Also:
    • remoteFileSeparator

      public S remoteFileSeparator(String remoteFileSeparator)
      Configure the file name path separator used by the remote system. Defaults to '/'.
      Parameters:
      remoteFileSeparator - the remoteFileSeparator.
      Returns:
      the spec.
    • localFilenameExpression

      public S localFilenameExpression(String localFilenameExpression)
      Configure a SpEL expression to generate the local file name; the root object for the evaluation is the remote file name.
      Parameters:
      localFilenameExpression - the localFilenameExpression.
      Returns:
      the spec.
    • localFilename

      public S localFilename(Function<String,String> localFilenameFunction)
      Configure a Function to be invoked to generate the local file name; argument passed to the apply method is the remote file name.
      Parameters:
      localFilenameFunction - the localFilenameFunction.
      Returns:
      the spec.
      See Also:
    • localFilenameExpression

      public S localFilenameExpression(Expression localFilenameExpression)
      Configure a SpEL expression to generate the local file name; the root object for the evaluation is the remote file name.
      Parameters:
      localFilenameExpression - the localFilenameExpression.
      Returns:
      the spec.
    • temporaryFileSuffix

      public S temporaryFileSuffix(String temporaryFileSuffix)
      Configure a suffix to temporarily apply to the local filename; when copied the file is renamed to its final name. Default: '.writing'.
      Parameters:
      temporaryFileSuffix - the temporaryFileSuffix.
      Returns:
      the spec.
    • remoteDirectory

      public S remoteDirectory(String remoteDirectory)
      Specify the full path to the remote directory.
      Parameters:
      remoteDirectory - the remoteDirectory.
      Returns:
      the spec.
      See Also:
    • remoteDirectoryExpression

      public S remoteDirectoryExpression(Expression remoteDirectoryExpression)
      Specify an expression that evaluates to the full path to the remote directory.
      Parameters:
      remoteDirectoryExpression - The remote directory expression.
      Returns:
      the spec.
    • filter

      public S filter(FileListFilter<F> filter)
      Configure a FileListFilter to be applied to the remote files before copying them.
      Parameters:
      filter - the filter.
      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:
    • patternFilter

      public abstract S patternFilter(String pattern)
      Configure a simple pattern filter (e.g. '*.txt').
      Parameters:
      pattern - the pattern.
      Returns:
      the spec.
      See Also:
    • regexFilter

      public abstract S regexFilter(String regex)
      Configure a regex pattern filter (e.g. '[0-9].*.txt').
      Parameters:
      regex - the regex.
      Returns:
      the spec.
      See Also:
    • deleteRemoteFiles

      public S deleteRemoteFiles(boolean deleteRemoteFiles)
      Set to true to enable deletion of remote files after successful transfer.
      Parameters:
      deleteRemoteFiles - true to delete.
      Returns:
      the spec.
    • preserveTimestamp

      public S preserveTimestamp(boolean preserveTimestamp)
      Set to true to enable the preservation of the remote file timestamp when transferring.
      Parameters:
      preserveTimestamp - true to preserve.
      Returns:
      the spec.
    • maxFetchSize

      public S maxFetchSize(int maxFetchSize)
      Specify the maximum number of remote files that will be fetched on each fetch attempt. A small number is recommended when multiple application instances are running, to avoid one instance from "grabbing" all the files.
      Parameters:
      maxFetchSize - the max fetch size.
      Returns:
      the spec.
      See Also:
    • remoteFileMetadataStore

      public S remoteFileMetadataStore(MetadataStore remoteFileMetadataStore)
      Configure a MetadataStore for remote files metadata.
      Parameters:
      remoteFileMetadataStore - the MetadataStore to use.
      Returns:
      the spec.
      Since:
      5.2
      See Also:
    • metadataStorePrefix

      public S metadataStorePrefix(String metadataStorePrefix)
      Configure a prefix for remote files metadata keys.
      Parameters:
      metadataStorePrefix - the metadata key prefix to use.
      Returns:
      the spec.
      Since:
      5.2
      See Also:
    • scanner

      public S scanner(DirectoryScanner scanner)
      Configure a scanner to use for the file system scan after transfer.
      Parameters:
      scanner - the scanner.
      Returns:
      the spec.
      Since:
      5.2.4
    • remoteComparator

      public S remoteComparator(Comparator<? extends F> remoteComparator)
      Set a comparator to sort the retrieved list of F (the Type that represents the remote file) prior to applying filters and max fetch size.
      Parameters:
      remoteComparator - the Comparator for remote files.
      Returns:
      the spec.
      Since:
      5.2.9
    • getComponentsToRegister

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