## 类 com.aliyun.oss.model.ObjectMetadata
的使用

- 使用ObjectMetadata的程序包
  程序包 | 说明
  --- | ---
  com.aliyun.oss |
  com.aliyun.oss.crypto |
  com.aliyun.oss.model |

- - ### com.aliyun.oss中ObjectMetadata的使用

    返回ObjectMetadata的com.aliyun.oss中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `ObjectMetadata` | OSSEncryptionClient.`getObject(GetObjectRequest req, File file)`
    `ObjectMetadata` | OSSClient.`getObject(GetObjectRequest getObjectRequest, File file)`
    `ObjectMetadata` | OSS.`getObject(GetObjectRequest getObjectRequest, File file)` Downloads the file from a file specified by the `GetObjectRequest` parameter.
    `ObjectMetadata` | OSSClient.`getObjectMetadata(GenericRequest genericRequest)`
    `ObjectMetadata` | OSS.`getObjectMetadata(GenericRequest genericRequest)` Gets all the metadata of `OSSObject`.
    `ObjectMetadata` | OSSClient.`getObjectMetadata(String bucketName, String key)`
    `ObjectMetadata` | OSS.`getObjectMetadata(String bucketName, String key)` Gets all the metadata of `OSSObject`.
    `ObjectMetadata` | OSSClient.`headObject(HeadObjectRequest headObjectRequest)`
    `ObjectMetadata` | OSS.`headObject(HeadObjectRequest headObjectRequest)` Gets all the head data of `OSSObject`.
    `ObjectMetadata` | OSSClient.`headObject(String bucketName, String key)`
    `ObjectMetadata` | OSS.`headObject(String bucketName, String key)` Gets all the head data of `OSSObject`.

    参数类型为ObjectMetadata的com.aliyun.oss中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `PutObjectResult` | OSSClient.`putObject(String bucketName, String key, File file, ObjectMetadata metadata)`
    `PutObjectResult` | OSS.`putObject(String bucketName, String key, File file, ObjectMetadata metadata)` Uploads the file to the `Bucket` from the file with the `ObjectMetadata`.
    `PutObjectResult` | OSSClient.`putObject(String bucketName, String key, InputStream input, ObjectMetadata metadata)`
    `PutObjectResult` | OSS.`putObject(String bucketName, String key, InputStream input, ObjectMetadata metadata)` Uploads the file to the `Bucket` from the @{link InputStream} with the `ObjectMetadata` information。

  - ### com.aliyun.oss.crypto中ObjectMetadata的使用

    返回ObjectMetadata的com.aliyun.oss.crypto中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `ObjectMetadata` | CryptoModuleDispatcher.`getObjectSecurely(GetObjectRequest req, File file)`
    `ObjectMetadata` | CryptoModuleBase.`getObjectSecurely(GetObjectRequest getObjectRequest, File file)` Gets the object in OSS and write it in a file, if it was an encrypted object then decrypt it, otherwise wirte the object directly.
    `ObjectMetadata` | CryptoModule.`getObjectSecurely(GetObjectRequest req, File file)`
    `protected ObjectMetadata` | CryptoModuleBase.`updateMetadataWithContentCryptoMaterial(ObjectMetadata metadata, File file, ContentCryptoMaterial contentCryptoMaterial)` Storages the encrytion materials in the object metadata.
    `protected ObjectMetadata` | CryptoModuleBase.`updateMetadataWithUploadContext(ObjectMetadata metadata, MultipartUploadCryptoContext context)` Add the upload part info into metadata.

    参数类型为ObjectMetadata的com.aliyun.oss.crypto中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `protected ContentCryptoMaterial` | CryptoModuleBase.`createContentMaterialFromMetadata(ObjectMetadata meta)` Builds a new content crypto material for decrypting the object achieved.
    `static boolean` | CryptoModuleBase.`hasEncryptionInfo(ObjectMetadata metadata)` Checks there an encryption info in the metadata.
    `protected long` | CryptoModuleBase.`plaintextLength(PutObjectRequest request, ObjectMetadata metadata)` Returns the plaintext length from the request and metadata; or -1 if unknown.
    `protected ObjectMetadata` | CryptoModuleBase.`updateMetadataWithContentCryptoMaterial(ObjectMetadata metadata, File file, ContentCryptoMaterial contentCryptoMaterial)` Storages the encrytion materials in the object metadata.
    `protected ObjectMetadata` | CryptoModuleBase.`updateMetadataWithUploadContext(ObjectMetadata metadata, MultipartUploadCryptoContext context)` Add the upload part info into metadata.

  - ### com.aliyun.oss.model中ObjectMetadata的使用

    com.aliyun.oss.model中ObjectMetadata的子类
    限定符和类型 | 类和说明
    --- | ---
    `class` | `SelectObjectMetadata` Metadata for select object requests.

    返回ObjectMetadata的com.aliyun.oss.model中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `ObjectMetadata` | PutObjectRequest.`getMetadata()`
    `ObjectMetadata` | OSSSymlink.`getMetadata()` Gets the metadata of the symlink file
    `ObjectMetadata` | CreateSymlinkRequest.`getMetadata()` Gets the symlink file's metadata.
    `ObjectMetadata` | CopyObjectRequest.`getNewObjectMetadata()` Gets target object's `ObjectMetadata`.
    `ObjectMetadata` | UploadFileRequest.`getObjectMetadata()`
    `ObjectMetadata` | OSSObject.`getObjectMetadata()` Gets the object's metadata
    `ObjectMetadata` | InitiateMultipartUploadRequest.`getObjectMetadata()` Gets the object's metadata.
    `ObjectMetadata` | DownloadFileResult.`getObjectMetadata()`

    参数类型为ObjectMetadata的com.aliyun.oss.model中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `void` | PutObjectRequest.`setMetadata(ObjectMetadata metadata)`
    `void` | OSSSymlink.`setMetadata(ObjectMetadata metadata)` Sets the metadata of the symlink file.
    `void` | CreateSymlinkRequest.`setMetadata(ObjectMetadata metadata)` Sets the symlink file's metadata.
    `void` | CopyObjectRequest.`setNewObjectMetadata(ObjectMetadata newObjectMetadata)` Sets target object's `ObjectMetadata`.
    `void` | UploadFileRequest.`setObjectMetadata(ObjectMetadata objectMetadata)`
    `void` | OSSObject.`setObjectMetadata(ObjectMetadata metadata)` Sets the object's metadata.
    `void` | InitiateMultipartUploadRequest.`setObjectMetadata(ObjectMetadata objectMetadata)` Sets the object's metadata.
    `void` | DownloadFileResult.`setObjectMetadata(ObjectMetadata objectMetadata)`

    参数类型为ObjectMetadata的com.aliyun.oss.model中的构造器
    构造器和说明
    `AppendObjectRequest(String bucketName, String key, File file, ObjectMetadata metadata)`
    `AppendObjectRequest(String bucketName, String key, InputStream input, ObjectMetadata metadata)`
    `InitiateMultipartUploadRequest(String bucketName, String key, ObjectMetadata objectMetadata)` Constructor
    `PutObjectRequest(String bucketName, String key, File file, ObjectMetadata metadata)`
    `PutObjectRequest(String bucketName, String key, InputStream input, ObjectMetadata metadata)`
    `SelectObjectMetadata(ObjectMetadata objectMetadata)`

Copyright © 2020. All Rights Reserved.