com.aliyun.oss.model

## 类 OSSObject

- java.lang.Object
- - com.aliyun.oss.model.GenericResult
  - - com.aliyun.oss.model.OSSObject

- 所有已实现的接口:
    Closeable, AutoCloseable

      public class OSSObject
      extends GenericResult
      implements Closeable

  The entity class for representing an object in OSS.

  In OSS, every file is an OSSObject and every single file should be less than 5G for using Simple upload, Form upload and Append Upload. Only multipart upload could upload a single file more than 5G. Any object has key, data and user metadata. The key is the object's name and the data is object's file content. The user metadata is a dictionary of key-value entries to store some custom data about the object.

  Object naming rules
  - use UTF-8 encoding
  - Length is between 1 to 1023
  - Could not have slash or backslash

- - ### 构造器概要

    构造器
    构造器和说明
    `OSSObject()`

  - ### 方法概要

    方法
    限定符和类型 | 方法和说明
    --- | ---
    `void` | `close()`
    `void` | `forcedClose()` Forcefully close the response.
    `String` | `getBucketName()` Gets the object's bucket name.
    `String` | `getKey()` Gets the object's key.
    `InputStream` | `getObjectContent()` Get's the object's content in `InputStream`.
    `ObjectMetadata` | `getObjectMetadata()` Gets the object's metadata
    `void` | `setBucketName(String bucketName)` Sets the object's bucket name.
    `void` | `setKey(String key)` Sets the object's key.
    `void` | `setObjectContent(InputStream objectContent)` Sets the object's content in `InputStream`.
    `void` | `setObjectMetadata(ObjectMetadata metadata)` Sets the object's metadata.
    `String` | `toString()`

    - ### 从类继承的方法 com.aliyun.oss.model.GenericResult

      `getClientCRC, getRequestId, getResponse, getServerCRC, setClientCRC, setRequestId, setResponse, setServerCRC`

    - ### 从类继承的方法 java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### 构造器详细资料

    - #### OSSObject

          public OSSObject()

  - ### 方法详细资料

    - #### getObjectMetadata

          public ObjectMetadata getObjectMetadata()

      Gets the object's metadata
      返回:
        Object's metadata in（`ObjectMetadata`

    - #### setObjectMetadata

          public void setObjectMetadata(ObjectMetadata metadata)

      Sets the object's metadata.
      参数:
        `metadata` - Object's metadata.

    - #### getObjectContent

          public InputStream getObjectContent()

      Get's the object's content in `InputStream`.
      返回:
        The object's content in `InputStream`.

    - #### setObjectContent

          public void setObjectContent(InputStream objectContent)

      Sets the object's content in `InputStream`.
      参数:
        `objectContent` - The object's content in `InputStream`.

    - #### getBucketName

          public String getBucketName()

      Gets the object's bucket name.
      返回:
        The object's bucket name.

    - #### setBucketName

          public void setBucketName(String bucketName)

      Sets the object's bucket name.
      参数:
        `bucketName` - The object's bucket name.

    - #### getKey

          public String getKey()

      Gets the object's key.
      返回:
        Object Key.

    - #### setKey

          public void setKey(String key)

      Sets the object's key.
      参数:
        `key` - Object Key.

    - #### close

          public void close()
                     throws IOException

      指定者:
        `close` 在接口中 `Closeable`
      指定者:
        `close` 在接口中 `AutoCloseable`
      抛出:
        `IOException`

    - #### forcedClose

          public void forcedClose()
                           throws IOException

      Forcefully close the response. The remaining data in the server will not be downloaded.
      抛出:
        `IOException`

    - #### toString

          public String toString()

      覆盖:
        `toString` 在类中 `Object`

Copyright © 2020. All Rights Reserved.