com.aliyun.oss

## 类 OSSEncryptionClient

- java.lang.Object
- - com.aliyun.oss.OSSClient
  - - com.aliyun.oss.OSSEncryptionClient

- 所有已实现的接口:
    OSS

      public class OSSEncryptionClient
      extends OSSClient

  OSSEncryptionClient is used to do client-side encryption.

- - ### 字段概要

    字段
    限定符和类型 | 字段和说明
    --- | ---
    `static String` | `USER_AGENT_SUFFIX`

  - ### 构造器概要

    构造器
    构造器和说明
    `OSSEncryptionClient(String endpoint, CredentialsProvider credsProvider, ClientConfiguration clientConfig, EncryptionMaterials encryptionMaterials, CryptoConfiguration cryptoConfig)`

  - ### 方法概要

    方法
    限定符和类型 | 方法和说明
    --- | ---
    `AppendObjectResult` | `appendObject(AppendObjectRequest appendObjectRequest)` 已过时。 please use normal oss client method `OSSClient.appendObject(AppendObjectRequest appendObjectRequest)`.
    `CompleteMultipartUploadResult` | `completeMultipartUpload(CompleteMultipartUploadRequest request, MultipartUploadCryptoContext context)`
    `DownloadFileResult` | `downloadFile(DownloadFileRequest downloadFileRequest)` File download Very similar with file upload, this method will split the OSS object into parts and download them in parallel by a thread pool, though by default the thread pool only has one thread.
    `OSSObject` | `getObject(GetObjectRequest req)` Gets the `OSSObject` from the bucket specified in `GetObjectRequest` parameter.
    `ObjectMetadata` | `getObject(GetObjectRequest req, File file)` Downloads the file from a file specified by the `GetObjectRequest` parameter.
    `InitiateMultipartUploadResult` | `initiateMultipartUpload(InitiateMultipartUploadRequest request)` 已过时。 please use encryption client method `initiateMultipartUpload(InitiateMultipartUploadRequest request, MultipartUploadCryptoContext context)`.
    `InitiateMultipartUploadResult` | `initiateMultipartUpload(InitiateMultipartUploadRequest request, MultipartUploadCryptoContext context)`
    `PutObjectResult` | `putObject(PutObjectRequest req)` Uploads the file to `Bucket`.
    `PutObjectResult` | `putObject(URL signedUrl, InputStream requestContent, long contentLength, Map<String,String> requestHeaders, boolean useChunkEncoding)` 已过时。 please use normal oss client method `OSSClient`#putObject(URL signedUrl, InputStream requestContent, long contentLength, Map requestHeaders, boolean useChunkEncoding).
    `UploadFileResult` | `uploadFile(UploadFileRequest uploadFileRequest)` File upload This method will automatically split files into parts and upload them in parallel by a thread pool, though by default the thread pool only has one thread.
    `UploadPartResult` | `uploadPart(UploadPartRequest request)` 已过时。 please use encryption client method `uploadPart(UploadPartRequest request, MultipartUploadCryptoContext context)`.
    `UploadPartResult` | `uploadPart(UploadPartRequest request, MultipartUploadCryptoContext context)`
    `UploadPartCopyResult` | `uploadPartCopy(UploadPartCopyRequest request)` 已过时。 please use normal oss client method `OSSClient.uploadPartCopy(UploadPartCopyRequest request)`.

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

      `abortMultipartUpload, addBucketCname, addBucketReplication, calculatePostSignature, completeMultipartUpload, copyObject, copyObject, createBucket, createBucket, createBucketVpcip, createLiveChannel, createSelectObjectMetadata, createSymlink, createSymlink, createUdf, createUdfApplication, createVpcip, deleteBucket, deleteBucket, deleteBucketCname, deleteBucketCname, deleteBucketCORSRules, deleteBucketCORSRules, deleteBucketEncryption, deleteBucketEncryption, deleteBucketImage, deleteBucketImage, deleteBucketInventoryConfiguration, deleteBucketInventoryConfiguration, deleteBucketLifecycle, deleteBucketLifecycle, deleteBucketLogging, deleteBucketLogging, deleteBucketPolicy, deleteBucketPolicy, deleteBucketQosInfo, deleteBucketQosInfo, deleteBucketReplication, deleteBucketReplication, deleteBucketTagging, deleteBucketTagging, deleteBucketVpcip, deleteBucketWebsite, deleteBucketWebsite, deleteImageStyle, deleteImageStyle, deleteLiveChannel, deleteLiveChannel, deleteObject, deleteObject, deleteObjects, deleteObjectTagging, deleteObjectTagging, deleteUdf, deleteUdfApplication, deleteUdfImage, deleteVersion, deleteVersion, deleteVersions, deleteVpcip, doesBucketExist, doesBucketExist, doesObjectExist, doesObjectExist, doesObjectExist, doesObjectExist, doesObjectExist, generatePostPolicy, generatePresignedUrl, generatePresignedUrl, generatePresignedUrl, generateRtmpUri, generateRtmpUri, generateVodPlaylist, generateVodPlaylist, getAsyncFetchTask, getAsyncFetchTask, getBucketAcl, getBucketAcl, getBucketCname, getBucketCname, getBucketCORS, getBucketCORSRules, getBucketCORSRules, getBucketEncryption, getBucketEncryption, getBucketImage, getBucketImage, getBucketInfo, getBucketInfo, getBucketInventoryConfiguration, getBucketInventoryConfiguration, getBucketLifecycle, getBucketLifecycle, getBucketLocation, getBucketLocation, getBucketLogging, getBucketLogging, getBucketMetadata, getBucketMetadata, getBucketPolicy, getBucketPolicy, getBucketProcess, getBucketProcess, getBucketQosInfo, getBucketQosInfo, getBucketReferer, getBucketReferer, getBucketReplication, getBucketReplication, getBucketReplicationLocation, getBucketReplicationLocation, getBucketReplicationProgress, getBucketReplicationProgress, getBucketRequestPayment, getBucketRequestPayment, getBucketStat, getBucketStat, getBucketStorageCapacity, getBucketStorageCapacity, getBucketTagging, getBucketTagging, getBucketVersioning, getBucketVersioning, getBucketVpcip, getBucketWebsite, getBucketWebsite, getClientConfiguration, getCredentialsProvider, getEndpoint, getImageStyle, getImageStyle, getLiveChannelHistory, getLiveChannelHistory, getLiveChannelInfo, getLiveChannelInfo, getLiveChannelStat, getLiveChannelStat, getMultipartOperation, getObject, getObject, getObjectAcl, getObjectAcl, getObjectMetadata, getObjectMetadata, getObjectOperation, getObjectTagging, getObjectTagging, getSimplifiedObjectMeta, getSimplifiedObjectMeta, getSymlink, getSymlink, getUdfApplicationInfo, getUdfApplicationLog, getUdfImageInfo, getUdfInfo, getUserQosInfo, getVodPlaylist, getVodPlaylist, headObject, headObject, isBucketExist, listBucketInventoryConfigurations, listBucketInventoryConfigurations, listBucketInventoryConfigurations, listBuckets, listBuckets, listBuckets, listImageStyle, listImageStyle, listLiveChannels, listLiveChannels, listMultipartUploads, listObjects, listObjects, listObjects, listObjectsV2, listObjectsV2, listObjectsV2, listObjectsV2, listParts, listUdfApplications, listUdfs, listVersions, listVersions, listVersions, listVpcip, optionsObject, processObject, putBucketImage, putImageStyle, putObject, putObject, putObject, putObject, putObject, putObject, putObject, resizeUdfApplication, restoreObject, restoreObject, restoreObject, restoreObject, selectObject, setAsyncFetchTask, setAsyncFetchTask, setBucketAcl, setBucketAcl, setBucketCORS, setBucketEncryption, setBucketInventoryConfiguration, setBucketInventoryConfiguration, setBucketLifecycle, setBucketLogging, setBucketPolicy, setBucketPolicy, setBucketProcess, setBucketQosInfo, setBucketQosInfo, setBucketReferer, setBucketReferer, setBucketRequestPayment, setBucketRequestPayment, setBucketStorageCapacity, setBucketStorageCapacity, setBucketTagging, setBucketTagging, setBucketTagging, setBucketVersioning, setBucketWebsite, setDownloadOperation, setEndpoint, setLiveChannelStatus, setLiveChannelStatus, setObjectAcl, setObjectAcl, setObjectTagging, setObjectTagging, setObjectTagging, setUploadOperation, shutdown, switchCredentials, switchSignatureVersion, upgradeUdfApplication, uploadUdfImage`

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

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

- - ### 字段详细资料

    - #### USER_AGENT_SUFFIX

          public static final String USER_AGENT_SUFFIX

      另请参阅:
        常量字段值

  - ### 构造器详细资料

    - #### OSSEncryptionClient

          public OSSEncryptionClient(String endpoint,
                             CredentialsProvider credsProvider,
                             ClientConfiguration clientConfig,
                             EncryptionMaterials encryptionMaterials,
                             CryptoConfiguration cryptoConfig)

  - ### 方法详细资料

    - #### putObject

          public PutObjectResult putObject(PutObjectRequest req)
                                    throws OSSException,
                                           ClientException

      从接口复制的说明: `OSS`
      Uploads the file to `Bucket`.
      指定者:
        `putObject` 在接口中 `OSS`
      覆盖:
        `putObject` 在类中 `OSSClient`
      参数:
        `req` - The `PutObjectRequest` instance that has bucket name, object key, metadata information.
      返回:
        A `PutObjectResult` instance.
      抛出:
        `OSSException`
        `ClientException`

    - #### getObject

          public OSSObject getObject(GetObjectRequest req)
                              throws OSSException,
                                     ClientException

      从接口复制的说明: `OSS`
      Gets the `OSSObject` from the bucket specified in `GetObjectRequest` parameter.
      指定者:
        `getObject` 在接口中 `OSS`
      覆盖:
        `getObject` 在类中 `OSSClient`
      参数:
        `req` - A `GetObjectRequest` instance which specifies the bucket name and the object key.
      返回:
        A `OSSObject` instance of the bucket file. The caller is responsible to close the connection after usage.
      抛出:
        `OSSException`
        `ClientException`

    - #### getObject

          public ObjectMetadata getObject(GetObjectRequest req,
                                 File file)
                                   throws OSSException,
                                          ClientException

      从接口复制的说明: `OSS`
      Downloads the file from a file specified by the `GetObjectRequest` parameter.
      指定者:
        `getObject` 在接口中 `OSS`
      覆盖:
        `getObject` 在类中 `OSSClient`
      参数:
        `req` - A `GetObjectRequest` instance which specifies bucket name and object key.
        `file` - Target file instance to download as.
      抛出:
        `OSSException`
        `ClientException`

    - #### uploadFile

          public UploadFileResult uploadFile(UploadFileRequest uploadFileRequest)
                                      throws Throwable

      从接口复制的说明: `OSS`
      File upload This method will automatically split files into parts and upload them in parallel by a thread pool, though by default the thread pool only has one thread. After all parts are uploaded, then it will merge them into one file. But if any one part fails to be uploaded, the whole upload fails. Optionally a checkpoint file could be used to track the progress of the upload and resume the upload later upon failure. Once the upload completes, the checkpoint file would be deleted. By default checkpoint file is disabled.
      指定者:
        `uploadFile` 在接口中 `OSS`
      覆盖:
        `uploadFile` 在类中 `OSSClient`
      参数:
        `uploadFileRequest` - A `UploadFileRequest` instance that specifies the bucket name, object key, file path ,part size (> 100K) and thread count (from 1 to 1000) and checkpoint file.
      返回:
        A `UploadFileRequest` instance which has the new uploaded file's key, ETag, location.
      抛出:
        `Throwable`

    - #### downloadFile

          public DownloadFileResult downloadFile(DownloadFileRequest downloadFileRequest)
                                          throws Throwable

      从接口复制的说明: `OSS`
      File download Very similar with file upload, this method will split the OSS object into parts and download them in parallel by a thread pool, though by default the thread pool only has one thread. After all parts are downloaded, then the method will merge them into one file. But if any one part fails to be downloaded, the whole download fails. Optionally a checkpoint file could be used to track the progress of the download and resume the download later upon failure. Once the download completes, the checkpoint file would be deleted. By default checkpoint file is disabled.
      指定者:
        `downloadFile` 在接口中 `OSS`
      覆盖:
        `downloadFile` 在类中 `OSSClient`
      参数:
        `downloadFileRequest` - A `DownloadFileRequest` instance that specifies the bucket name, object key, file path, part size (> 100K) and thread count (from 1 to 1000) and checkpoint file. Also it could have the ETag and ModifiedSince constraints.
      返回:
        A `DownloadFileResult` instance that has the `ObjectMetadata` information.
      抛出:
        `Throwable`

    - #### initiateMultipartUpload

          public InitiateMultipartUploadResult initiateMultipartUpload(InitiateMultipartUploadRequest request,
                                                              MultipartUploadCryptoContext context)
                                                                throws OSSException,
                                                                       ClientException

      抛出:
        `OSSException`
        `ClientException`

    - #### uploadPart

          public UploadPartResult uploadPart(UploadPartRequest request,
                                    MultipartUploadCryptoContext context)

    - #### completeMultipartUpload

          public CompleteMultipartUploadResult completeMultipartUpload(CompleteMultipartUploadRequest request,
                                                              MultipartUploadCryptoContext context)
                                                                throws OSSException,
                                                                       ClientException

      抛出:
        `OSSException`
        `ClientException`

    - #### initiateMultipartUpload

          @Deprecated
          public InitiateMultipartUploadResult initiateMultipartUpload(InitiateMultipartUploadRequest request)
                                                                throws ClientException

      已过时。 please use encryption client method `initiateMultipartUpload(InitiateMultipartUploadRequest request, MultipartUploadCryptoContext context)`.
      Note: This method is disabled in encryption client.
      指定者:
        `initiateMultipartUpload` 在接口中 `OSS`
      覆盖:
        `initiateMultipartUpload` 在类中 `OSSClient`
      参数:
        `request` - A `InitiateMultipartUploadRequest` instance which specifies the bucket name, object key and metadata.
      返回:
        a `InitiateMultipartUploadResult` instance which has the global unique id if succeeds.
      抛出:
        `ClientException`

    - #### uploadPart

          @Deprecated
          public UploadPartResult uploadPart(UploadPartRequest request)
                                      throws ClientException

      已过时。 please use encryption client method `uploadPart(UploadPartRequest request, MultipartUploadCryptoContext context)`.
      Note: This method is disabled in encryption client.
      指定者:
        `uploadPart` 在接口中 `OSS`
      覆盖:
        `uploadPart` 在类中 `OSSClient`
      参数:
        `request` - A `UploadPartRequest` instance which specifies bucket, object key, upload id, part number, content and length, MD5 digest and chunked transfer encoding flag.
      返回:
        UploadPartResult A `UploadPartResult` instance to indicate the upload result.
      抛出:
        `ClientException`

    - #### appendObject

          @Deprecated
          public AppendObjectResult appendObject(AppendObjectRequest appendObjectRequest)
                                          throws ClientException

      已过时。 please use normal oss client method `OSSClient.appendObject(AppendObjectRequest appendObjectRequest)`.
      Note: This method is disabled in encryption client.
      指定者:
        `appendObject` 在接口中 `OSS`
      覆盖:
        `appendObject` 在类中 `OSSClient`
      参数:
        `appendObjectRequest` - A `AppendObjectRequest` instance which specifies the bucket name, appendable object key, the file or the InputStream object to append.
      返回:
        A `AppendObjectResult` instance.
      抛出:
        `ClientException`

    - #### uploadPartCopy

          @Deprecated
          public UploadPartCopyResult uploadPartCopy(UploadPartCopyRequest request)
                                              throws ClientException

      已过时。 please use normal oss client method `OSSClient.uploadPartCopy(UploadPartCopyRequest request)`.
      Note: This method is disabled in encryption client.
      指定者:
        `uploadPartCopy` 在接口中 `OSS`
      覆盖:
        `uploadPartCopy` 在类中 `OSSClient`
      参数:
        `request` - A `UploadPartCopyRequest` instance which specifies: 1) source file 2) source file's copy range 3) target file 4) target file's upload Id and its part number 5) constraints such as ETag match or non-match, last modified match or non-match, etc.
      返回:
        A `UploadPartCopyResult` instance which has the part number and ETag upon a successful upload.
      抛出:
        `ClientException`

    - #### putObject

          @Deprecated
          public PutObjectResult putObject(URL signedUrl,
                                             InputStream requestContent,
                                             long contentLength,
                                             Map<String,String> requestHeaders,
                                             boolean useChunkEncoding)
                                    throws ClientException

      已过时。 please use normal oss client method `OSSClient`#putObject(URL signedUrl, InputStream requestContent, long contentLength, Map requestHeaders, boolean useChunkEncoding).
      Note: This method is disabled in encryption client.
      指定者:
        `putObject` 在接口中 `OSS`
      覆盖:
        `putObject` 在类中 `OSSClient`
      参数:
        `signedUrl` - Signed Url, which has the bucket name, object key, account information and accessed Ids and its signature. The url is recommended to be generated by generatePresignedUrl().
        `requestContent` - `InputStream` instance to read from.
        `contentLength` - Hint content length to write. if useChunkEncoding is true, then -1 is used.
        `requestHeaders` - Rquest headers,including standard or customized http headers documented by PutObject REST API.
        `useChunkEncoding` - The flag of using chunked transfer encoding.
      返回:
        A `PutObjectResult` instance.
      抛出:
        `ClientException`

Copyright © 2020. All Rights Reserved.