Class PullTask.PullTaskBuilder

Enclosing class:
PullTask

Builder for PullTask.
  • Method Details

    • create

      public static PullTask.PullTaskBuilder create()
      Returns:
      builder
    • addPaths

      public PullTask.PullTaskBuilder addPaths(Collection<String> filePaths)
      Add a collection of paths to transfer. Each should be the path of the Local file, and will be resolved against the current virtual file system configured on the SftpClient.
      Parameters:
      filePaths - file paths to add.
      Returns:
      builder for chaining
    • addPaths

      public PullTask.PullTaskBuilder addPaths(String... paths)
      Add a collection of paths to transfer. Each should be the path of the Local file, and will be resolved against the current virtual file system configured on the SftpClient.
      Parameters:
      paths - file paths to add.
      Returns:
      builder for chaining
    • withPaths

      public PullTask.PullTaskBuilder withPaths(String... paths)
      Set an array of files to transfer. Any paths already added to this builder will be replaced. Each should be the path of the Local file, and will be resolved against the current virtual file system configured on the SftpClient.
      Parameters:
      paths - all file paths to transfer.
      Returns:
      builder for chaining
    • withPaths

      public PullTask.PullTaskBuilder withPaths(Collection<String> filePaths)
      Set an array of files to transfer. Any paths already added to this builder will be replaced. Each should be the path of the Local file, and will be resolved against the current virtual file system configured on the SftpClient.
      Parameters:
      filePaths - all file paths to transfer.
      Returns:
      builder for chaining
    • withLocalFolder

      public PullTask.PullTaskBuilder withLocalFolder(String localFolder)
      Set the local folder where any transferred paths will be placed.
      Parameters:
      localFolder - remote folder
      Returns:
      builder for chaining
    • withLocalFolder

      public PullTask.PullTaskBuilder withLocalFolder(Path localFolder)
      Set the remote folder where any transferred paths will be placed.
      Parameters:
      localFolder - remote folder
      Returns:
      builder for chaining
    • withLocalFolder

      public PullTask.PullTaskBuilder withLocalFolder(Optional<Path> localFolder)
      Set the remote folder where any transferred paths will be placed. If this evaluates to Optional.empty(), then the default remote folder will be used (e.g. the users home directory).
      Parameters:
      localFolder - local folder
      Returns:
      builder for chaining
    • build

      public PullTask build()
      Build a new PullTask that may be scheduled for execution (e.g. SshClient.addTask(Task)). The created task takes a copy of the configuration in this builder for the immutable task, so if the builder is changed after building the task instance, it will not be affected.
      Specified by:
      build in class AbstractFileTask.AbstractFileTaskBuilder<PullTask.PullTaskBuilder,PullTask>
      Returns:
      task