类 PutObjectRequest

直接已知子类:
AppendObjectRequest, NewFileRequest

public class PutObjectRequest extends PutObjectBasicRequest
Parameters in an object upload request
  • 字段详细资料

    • file

      protected File file
    • input

      protected InputStream input
    • metadata

      protected ObjectMetadata metadata
    • expires

      protected int expires
    • offset

      protected long offset
  • 构造器详细资料

    • PutObjectRequest

      public PutObjectRequest()
    • PutObjectRequest

      public PutObjectRequest(String bucketName)
    • PutObjectRequest

      public PutObjectRequest(PutObjectBasicRequest request)
    • PutObjectRequest

      public PutObjectRequest(String bucketName, String objectKey)
      Constructor
      参数:
      bucketName - Bucket name
      objectKey - Object name
    • PutObjectRequest

      public PutObjectRequest(String bucketName, String objectKey, File file)
      Constructor
      参数:
      bucketName - Bucket name
      objectKey - Object name
      file - File to be uploaded
    • PutObjectRequest

      public PutObjectRequest(String bucketName, String objectKey, InputStream input)
      Constructor
      参数:
      bucketName - Bucket name
      objectKey - Object name
      input - Data stream to be uploaded
  • 方法详细资料

    • getOffset

      public long getOffset()
      Obtain the start position of the to-be-uploaded content in the file. This parameter is effective only when the path where the file is to be uploaded is configured.
      返回:
      Start position of the content to be uploaded in the local file
    • setOffset

      public void setOffset(long offset)
      Set the start position of the to-be-uploaded content in the file. This parameter is effective only when the path where the file is to be uploaded is configured. The unit is byte and the default value is 0.
      参数:
      offset - Start position of the content to be uploaded in the local file
    • getInput

      public InputStream getInput()
      Obtain the data stream to be uploaded, which cannot be used with the file to be uploaded.
      返回:
      Data stream to be uploaded
    • setInput

      public void setInput(InputStream input)
      Set the data stream to be uploaded, which cannot be used with the file to be uploaded.
      参数:
      input - Data stream to be uploaded
    • getMetadata

      public ObjectMetadata getMetadata()
      Obtain object properties, including "content-type", "content-length", "content-md5", and customized metadata.
      返回:
      Object properties
    • setMetadata

      public void setMetadata(ObjectMetadata metadata)
      Set the object properties, including "content-type", "content-length", and customized metadata.
      参数:
      metadata - Object properties
    • getFile

      public File getFile()
      Obtain the file to be uploaded, which cannot be used with the data stream.
      返回:
      File to be uploaded
    • setFile

      public void setFile(File file)
      Set the file to be uploaded, which cannot be used with the data stream.
      参数:
      file - File to be uploaded
    • getExpires

      public int getExpires()
      Obtain the expiration time of the object.
      返回:
      Expiration time of the object
    • setExpires

      public void setExpires(int expires)
      Set the expiration time of the object. The value must be a positive integer.
      参数:
      expires - Expiration time of the object
    • isAutoClose

      public boolean isAutoClose()
      Check whether the input stream will be automatically closed. The default value is "true".
      返回:
      Identifier specifying whether the input stream will be automatically closed
    • setAutoClose

      public void setAutoClose(boolean autoClose)
      Specify whether to automatically close the input stream. The default value is "true".
      参数:
      autoClose - Identifier specifying whether the input stream will be automatically closed
    • getProgressListener

      public ProgressListener getProgressListener()
      Obtain the data transfer listener.
      返回:
      Data transfer listener
    • setProgressListener

      public void setProgressListener(ProgressListener progressListener)
      Set the data transfer listener.
      参数:
      progressListener - Data transfer listener
    • getProgressInterval

      public long getProgressInterval()
      Obtain the callback threshold of the data transfer listener. The default value is 100 KB.
      返回:
      Callback threshold of the data transfer listener
    • setProgressInterval

      public void setProgressInterval(long progressInterval)
      Set the callback threshold of the data transfer listener. The default value is 100 KB.
      参数:
      progressInterval - Callback threshold of the data transfer listener
    • getCallback

      public Callback getCallback()
    • setCallback

      public void setCallback(Callback callback)
    • isNeedCalculateCRC64

      public boolean isNeedCalculateCRC64()
      返回:
      Whether you need sdk to calculate CRC64 value and add it to header
    • setNeedCalculateCRC64

      public void setNeedCalculateCRC64(boolean needCalculateCRC64)
      参数:
      needCalculateCRC64 - Whether you need sdk to calculate CRC64 value and add it to header
    • toString

      public String toString()
      覆盖:
      toString 在类中 BaseObjectRequest