Interface FileAsyncRequestBody.Builder

All Superinterfaces:
Buildable, SdkBuilder<FileAsyncRequestBody.Builder,FileAsyncRequestBody>
Enclosing class:
FileAsyncRequestBody

public static interface FileAsyncRequestBody.Builder extends SdkBuilder<FileAsyncRequestBody.Builder,FileAsyncRequestBody>
A builder for FileAsyncRequestBody.
  • Method Details

    • path

      Sets the file to send to the service.
      Parameters:
      path - Path to file to read.
      Returns:
      This builder for method chaining.
    • chunkSizeInBytes

      FileAsyncRequestBody.Builder chunkSizeInBytes(Integer chunkSize)
      Sets the size of chunks to read from the file. Increasing this will cause more data to be buffered into memory but may yield better latencies. Decreasing this will reduce memory usage but may cause reduced latency. Setting this value is very dependent on upload speed and requires some performance testing to tune.

      The default chunk size is 16384 bytes

      Parameters:
      chunkSize - New chunk size in bytes.
      Returns:
      This builder for method chaining.
    • position

      FileAsyncRequestBody.Builder position(Long position)
      Sets the file position at which the request body begins.

      By default, it's 0, i.e., reading from the beginning.

      Parameters:
      position - the position of the file
      Returns:
      The builder for method chaining.
    • numBytesToRead

      FileAsyncRequestBody.Builder numBytesToRead(Long numBytesToRead)
      Sets the number of bytes to read from this file.

      By default, it's same as the file length.

      Parameters:
      numBytesToRead - number of bytes to read
      Returns:
      The builder for method chaining.
    • modifiedTimeAtStart

      FileAsyncRequestBody.Builder modifiedTimeAtStart(FileTime modifiedTimeAtStart)
      Optional - sets the file modified time at the start of the request.
      Parameters:
      modifiedTimeAtStart - initial file modification time
      Returns:
      The builder for method chaining.
    • sizeAtStart

      FileAsyncRequestBody.Builder sizeAtStart(Long sizeAtStart)
      Optional - sets the file size in bytes at the start of the request.
      Parameters:
      sizeAtStart - initial file size at start.
      Returns:
      The builder for method chaining.
    • confineToRoot

      FileAsyncRequestBody.Builder confineToRoot(Path confineToRoot)
      Sets a directory that contains the file. When set, the file is resolved below this directory without following a symbolic link in any path component below it, every time its attributes are read or it is opened. A symbolic link in any of those components makes the read fail. The directory itself is trusted.

      By default, it's null, and the file is read normally, following symbolic links.

      Parameters:
      confineToRoot - the directory below which the file must be resolved
      Returns:
      The builder for method chaining.