Class ShareFileUploadOptions

java.lang.Object
com.azure.storage.file.share.models.ShareFileUploadOptions

public final class ShareFileUploadOptions extends Object
Extended options that may be passed when uploading a file range.
  • Constructor Details

    • ShareFileUploadOptions

      public ShareFileUploadOptions(Flux<ByteBuffer> dataFlux)
      Constructs a new FileParallelUploadOptions.
      Parameters:
      dataFlux - The data to write to the file. Unlike other upload methods, this method does not require that the Flux be replayable. In other words, it does not have to support multiple subscribers and is not expected to produce the same values across subscriptions. data provided in the InputStream.
      Throws:
      NullPointerException - If dataFlux is null.
    • ShareFileUploadOptions

      @Deprecated public ShareFileUploadOptions(InputStream dataStream, long length)
      Deprecated.
      length is no longer necessary; use ShareFileUploadOptions(InputStream) instead.
      Constructs a new FileParallelUploadOptions.

      Use ShareFileUploadOptions(InputStream) instead to supply an InputStream without knowing the exact length beforehand.

      Parameters:
      dataStream - The data to write to the file. The data must be markable. This is in order to support retries. If the data is not markable, consider wrapping your data source in a BufferedInputStream to add mark support.
      length - The exact length of the data. It is important that this value match precisely the length of the data provided in the InputStream.
      Throws:
      NullPointerException - If dataStream is null.
      IllegalArgumentException - If length is less than 0 or greater than Long.MAX_VALUE.
    • ShareFileUploadOptions

      public ShareFileUploadOptions(InputStream dataStream)
      Constructs a new FileParallelUploadOptions.
      Parameters:
      dataStream - The data to write to the file. The data must be markable. This is in order to support retries. If the data is not markable, consider wrapping your data source in a BufferedInputStream to add mark support.
      Throws:
      NullPointerException - If dataStream is null.
  • Method Details

    • getDataFlux

      public Flux<ByteBuffer> getDataFlux()
      Gets the data source.
      Returns:
      The data to write to the file.
    • getDataStream

      public InputStream getDataStream()
      Gets the data source.
      Returns:
      The data to write to the file.
    • getLength

      public Long getLength()
      Gets the length of the data associated with an InputStream or Flux<ByteBuffer>.
      Returns:
      The exact length of the data. It is important that this value match precisely the length of the data provided in the InputStream or Flux<ByteBuffer>.
    • getOffset

      public Long getOffset()
      Gets the offset to start writing data at.
      Returns:
      Long position to write at.
    • setOffset

      public ShareFileUploadOptions setOffset(Long offset)
      Sets the offset to start writing data at.
      Parameters:
      offset - Long position to write at.
      Returns:
      The updated options.
    • getParallelTransferOptions

      public com.azure.storage.common.ParallelTransferOptions getParallelTransferOptions()
      Gets the ParallelTransferOptions.
      Returns:
      ParallelTransferOptions
    • setParallelTransferOptions

      public ShareFileUploadOptions setParallelTransferOptions(com.azure.storage.common.ParallelTransferOptions parallelTransferOptions)
      Sets the ParallelTransferOptions.
      Parameters:
      parallelTransferOptions - ParallelTransferOptions
      Returns:
      The updated options.
    • getRequestConditions

      public ShareRequestConditions getRequestConditions()
      Returns:
      ShareRequestConditions
    • setRequestConditions

      public ShareFileUploadOptions setRequestConditions(ShareRequestConditions requestConditions)
      Parameters:
      requestConditions - ShareRequestConditions
      Returns:
      The updated options.