content: /**
   * Copyright (C) Alibaba Cloud Computing, 2015
   * All rights reserved.
   * <p>
   * 版权所有 （C）阿里巴巴云计算，2015
   */
  
  package com.alibaba.sdk.android.oss;
  
  import android.content.Context;
  
  import com.alibaba.sdk.android.oss.callback.OSSCompletedCallback;
  import com.alibaba.sdk.android.oss.common.OSSLogToFileUtils;
  import com.alibaba.sdk.android.oss.common.auth.OSSCredentialProvider;
  import com.alibaba.sdk.android.oss.common.utils.OSSUtils;
  import com.alibaba.sdk.android.oss.internal.ExtensionRequestOperation;
  import com.alibaba.sdk.android.oss.internal.InternalRequestOperation;
  import com.alibaba.sdk.android.oss.internal.OSSAsyncTask;
  import com.alibaba.sdk.android.oss.internal.ObjectURLPresigner;
  import com.alibaba.sdk.android.oss.model.AbortMultipartUploadRequest;
  import com.alibaba.sdk.android.oss.model.AbortMultipartUploadResult;
  import com.alibaba.sdk.android.oss.model.AppendObjectRequest;
  import com.alibaba.sdk.android.oss.model.AppendObjectResult;
  import com.alibaba.sdk.android.oss.model.DeleteObjectTaggingRequest;
  import com.alibaba.sdk.android.oss.model.DeleteObjectTaggingResult;
  import com.alibaba.sdk.android.oss.model.GetObjectMetaRequest;
  import com.alibaba.sdk.android.oss.model.GetObjectMetaResult;
  import com.alibaba.sdk.android.oss.model.GetObjectTaggingRequest;
  import com.alibaba.sdk.android.oss.model.GetObjectTaggingResult;
  import com.alibaba.sdk.android.oss.model.PutObjectTaggingRequest;
  import com.alibaba.sdk.android.oss.model.PutObjectTaggingResult;
  import com.alibaba.sdk.android.oss.model.ResumableDownloadResult;
  import com.alibaba.sdk.android.oss.model.CompleteMultipartUploadRequest;
  import com.alibaba.sdk.android.oss.model.CompleteMultipartUploadResult;
  import com.alibaba.sdk.android.oss.model.CopyObjectRequest;
  import com.alibaba.sdk.android.oss.model.CopyObjectResult;
  import com.alibaba.sdk.android.oss.model.CreateBucketRequest;
  import com.alibaba.sdk.android.oss.model.CreateBucketResult;
  import com.alibaba.sdk.android.oss.model.DeleteBucketLifecycleRequest;
  import com.alibaba.sdk.android.oss.model.DeleteBucketLifecycleResult;
  import com.alibaba.sdk.android.oss.model.DeleteBucketLoggingRequest;
  import com.alibaba.sdk.android.oss.model.DeleteBucketLoggingResult;
  import com.alibaba.sdk.android.oss.model.DeleteBucketRequest;
  import com.alibaba.sdk.android.oss.model.DeleteBucketResult;
  import com.alibaba.sdk.android.oss.model.DeleteMultipleObjectRequest;
  import com.alibaba.sdk.android.oss.model.DeleteMultipleObjectResult;
  import com.alibaba.sdk.android.oss.model.DeleteObjectRequest;
  import com.alibaba.sdk.android.oss.model.DeleteObjectResult;
  import com.alibaba.sdk.android.oss.model.GeneratePresignedUrlRequest;
  import com.alibaba.sdk.android.oss.model.GetBucketACLRequest;
  import com.alibaba.sdk.android.oss.model.GetBucketACLResult;
  import com.alibaba.sdk.android.oss.model.GetBucketInfoRequest;
  import com.alibaba.sdk.android.oss.model.GetBucketInfoResult;
  import com.alibaba.sdk.android.oss.model.GetBucketLifecycleRequest;
  import com.alibaba.sdk.android.oss.model.GetBucketLifecycleResult;
  import com.alibaba.sdk.android.oss.model.GetBucketLoggingRequest;
  import com.alibaba.sdk.android.oss.model.GetBucketLoggingResult;
  import com.alibaba.sdk.android.oss.model.GetBucketRefererRequest;
  import com.alibaba.sdk.android.oss.model.GetBucketRefererResult;
  import com.alibaba.sdk.android.oss.model.GetObjectACLRequest;
  import com.alibaba.sdk.android.oss.model.GetObjectACLResult;
  import com.alibaba.sdk.android.oss.model.GetObjectRequest;
  import com.alibaba.sdk.android.oss.model.GetObjectResult;
  import com.alibaba.sdk.android.oss.model.GetSymlinkRequest;
  import com.alibaba.sdk.android.oss.model.GetSymlinkResult;
  import com.alibaba.sdk.android.oss.model.HeadObjectRequest;
  import com.alibaba.sdk.android.oss.model.HeadObjectResult;
  import com.alibaba.sdk.android.oss.model.ImagePersistRequest;
  import com.alibaba.sdk.android.oss.model.ImagePersistResult;
  import com.alibaba.sdk.android.oss.model.InitiateMultipartUploadRequest;
  import com.alibaba.sdk.android.oss.model.InitiateMultipartUploadResult;
  import com.alibaba.sdk.android.oss.model.ListBucketsRequest;
  import com.alibaba.sdk.android.oss.model.ListBucketsResult;
  import com.alibaba.sdk.android.oss.model.ListMultipartUploadsRequest;
  import com.alibaba.sdk.android.oss.model.ListMultipartUploadsResult;
  import com.alibaba.sdk.android.oss.model.ListObjectsRequest;
  import com.alibaba.sdk.android.oss.model.ListObjectsResult;
  import com.alibaba.sdk.android.oss.model.ListPartsRequest;
  import com.alibaba.sdk.android.oss.model.ListPartsResult;
  import com.alibaba.sdk.android.oss.model.ResumableDownloadRequest;
  import com.alibaba.sdk.android.oss.model.MultipartUploadRequest;
  import com.alibaba.sdk.android.oss.model.PutBucketLifecycleRequest;
  import com.alibaba.sdk.android.oss.model.PutBucketLifecycleResult;
  import com.alibaba.sdk.android.oss.model.PutBucketLoggingRequest;
  import com.alibaba.sdk.android.oss.model.PutBucketLoggingResult;
  import com.alibaba.sdk.android.oss.model.PutBucketRefererRequest;
  import com.alibaba.sdk.android.oss.model.PutBucketRefererResult;
  import com.alibaba.sdk.android.oss.model.PutObjectRequest;
  import com.alibaba.sdk.android.oss.model.PutObjectResult;
  import com.alibaba.sdk.android.oss.model.PutSymlinkRequest;
  import com.alibaba.sdk.android.oss.model.PutSymlinkResult;
  import com.alibaba.sdk.android.oss.model.RestoreObjectRequest;
  import com.alibaba.sdk.android.oss.model.RestoreObjectResult;
  import com.alibaba.sdk.android.oss.model.ResumableUploadRequest;
  import com.alibaba.sdk.android.oss.model.ResumableUploadResult;
  import com.alibaba.sdk.android.oss.model.TriggerCallbackRequest;
  import com.alibaba.sdk.android.oss.model.TriggerCallbackResult;
  import com.alibaba.sdk.android.oss.model.UploadPartRequest;
  import com.alibaba.sdk.android.oss.model.UploadPartResult;
  import com.alibaba.sdk.android.oss.signer.SignVersion;
  
  import java.io.IOException;
  import java.net.URI;
  import java.net.URISyntaxException;
  
  /**
   * The entry point class of (Open Storage Service, OSS）, which is the implementation of interface
   * OSS.
   */
  class OSSImpl implements OSS {
  
      private URI endpointURI;
      private OSSCredentialProvider credentialProvider;
      private InternalRequestOperation internalRequestOperation;
      private ExtensionRequestOperation extensionRequestOperation;
      private ClientConfiguration conf;
  
      private ObjectURLPresigner objectURLPresigner;
  
      /**
       * Creates a {@link OSSImpl} instance.
       *
       * @param context            a android application's application context
       * @param endpoint           OSS endpoint, check out:http://help.aliyun.com/document_detail/oss/user_guide/endpoint_region.html
       * @param credentialProvider credential provider instance
       * @param conf               Client side configuration
       */
      public OSSImpl(Context context, String endpoint, OSSCredentialProvider credentialProvider, ClientConfiguration conf) {
          this.conf = (conf == null ? ClientConfiguration.getDefaultConf() : conf);
          OSSLogToFileUtils.init(context.getApplicationContext(), conf);//init log
          try {
              endpoint = endpoint.trim();
              if (!endpoint.startsWith("http")) {
                  endpoint = this.conf.getHttpProtocol().toString() + "://" + endpoint;
              }
              this.endpointURI = new URI(endpoint);
          } catch (URISyntaxException e) {
              throw new IllegalArgumentException("Endpoint must be a string like 'http://oss-cn-****.aliyuncs.com'," +
                      "or your cname like 'http://image.cnamedomain.com'!");
          }
          if (credentialProvider == null) {
              throw new IllegalArgumentException("CredentialProvider can't be null.");
          }
  
          Boolean hostIsIP = false;
          try {
              hostIsIP = OSSUtils.isValidateIP(this.endpointURI.getHost());
          } catch (Exception e) {
              e.printStackTrace();
          }
  
          if (this.endpointURI.getScheme().equals("https") && hostIsIP) {
              throw new IllegalArgumentException("endpoint should not be format with https://ip.");
          }
  
          this.credentialProvider = credentialProvider;
  
          internalRequestOperation = new InternalRequestOperation(context.getApplicationContext(), endpointURI, credentialProvider, this.conf);
          extensionRequestOperation = new ExtensionRequestOperation(internalRequestOperation);
          objectURLPresigner = new ObjectURLPresigner(this.endpointURI, this.credentialProvider, this.conf);
      }
  
      public OSSImpl(Context context, OSSCredentialProvider credentialProvider, ClientConfiguration conf) {
          this.credentialProvider = credentialProvider;
          this.conf = (conf == null ? ClientConfiguration.getDefaultConf() : conf);
          internalRequestOperation = new InternalRequestOperation(context.getApplicationContext(), credentialProvider, this.conf);
          extensionRequestOperation = new ExtensionRequestOperation(internalRequestOperation);
      }
  
      /**
       * Sets OSS services Region.
       *
       * @param region
       *            OSS services Region.
       */
      public void setRegion(String region) {
          internalRequestOperation.setRegion(region);
          if (objectURLPresigner != null) {
              objectURLPresigner.setRegion(region);
          }
      }
  
      /**
       * Sets OSS cloud box id.
       *
       * @param cloudBoxId OSS cloud box id.
       */
      public void setCloudBoxId(String cloudBoxId) {
          internalRequestOperation.setCloudBoxId(cloudBoxId);
          if (objectURLPresigner != null) {
              objectURLPresigner.setCloudBoxId(cloudBoxId);
          }
      }
  
      public void setProduct(String product) {
          internalRequestOperation.setProduct(product);
          if (objectURLPresigner != null) {
              objectURLPresigner.setProduct(product);
          }
      }
  
      @Override
      public OSSAsyncTask<ListBucketsResult> asyncListBuckets(
              ListBucketsRequest request, OSSCompletedCallback<ListBucketsRequest, ListBucketsResult> completedCallback) {
          return internalRequestOperation.listBuckets(request, completedCallback);
      }
  
      @Override
      public ListBucketsResult listBuckets(ListBucketsRequest request)
              throws ClientException, ServiceException {
          return internalRequestOperation.listBuckets(request, null).getResult();
      }
  
      @Override
      public OSSAsyncTask<CreateBucketResult> asyncCreateBucket(
              CreateBucketRequest request, OSSCompletedCallback<CreateBucketRequest, CreateBucketResult> completedCallback) {
  
          return internalRequestOperation.createBucket(request, completedCallback);
      }
  
      @Override
      public CreateBucketResult createBucket(CreateBucketRequest request)
              throws ClientException, ServiceException {
  
          return internalRequestOperation.createBucket(request, null).getResult();
      }
  
      @Override
      public OSSAsyncTask<DeleteBucketResult> asyncDeleteBucket(
              DeleteBucketRequest request, OSSCompletedCallback<DeleteBucketRequest, DeleteBucketResult> completedCallback) {
  
          return internalRequestOperation.deleteBucket(request, completedCallback);
      }
  
      @Override
      public DeleteBucketResult deleteBucket(DeleteBucketRequest request)
              throws ClientException, ServiceException {
  
          return internalRequestOperation.deleteBucket(request, null).getResult();
      }
  
      @Override
      public OSSAsyncTask<GetBucketInfoResult> asyncGetBucketInfo(GetBucketInfoRequest request, OSSCompletedCallback<GetBucketInfoRequest, GetBucketInfoResult> completedCallback) {
          return internalRequestOperation.getBucketInfo(request, completedCallback);
      }
  
      @Override
      public GetBucketInfoResult getBucketInfo(GetBucketInfoRequest request) throws ClientException, ServiceException {
          return internalRequestOperation.getBucketInfo(request, null).getResult();
      }
  
      @Override
      public OSSAsyncTask<GetBucketACLResult> asyncGetBucketACL(
              GetBucketACLRequest request, OSSCompletedCallback<GetBucketACLRequest, GetBucketACLResult> completedCallback) {
  
          return internalRequestOperation.getBucketACL(request, completedCallback);
      }
  
      @Override
      public GetBucketACLResult getBucketACL(GetBucketACLRequest request)
              throws ClientException, ServiceException {
  
          return internalRequestOperation.getBucketACL(request, null).getResult();
      }
  
      @Override
      public OSSAsyncTask<PutBucketRefererResult> asyncPutBucketReferer(PutBucketRefererRequest request, OSSCompletedCallback<PutBucketRefererRequest, PutBucketRefererResult> completedCallback) {
          return internalRequestOperation.putBucketReferer(request, completedCallback);
      }
  
      @Override
      public PutBucketRefererResult putBucketReferer(PutBucketRefererRequest request) throws ClientException, ServiceException {
          return internalRequestOperation.putBucketReferer(request, null).getResult();
      }
  
      @Override
      public GetBucketRefererResult getBucketReferer(GetBucketRefererRequest request) throws ClientException, ServiceException {
          return internalRequestOperation.getBucketReferer(request, null).getResult();
      }
  
      @Override
      public OSSAsyncTask<GetBucketRefererResult> asyncGetBucketReferer(GetBucketRefererRequest request, OSSCompletedCallback<GetBucketRefererRequest, GetBucketRefererResult> completedCallback) {
          return internalRequestOperation.getBucketReferer(request, completedCallback);
      }
  
      @Override
      public DeleteBucketLoggingResult deleteBucketLogging(DeleteBucketLoggingRequest request) throws ClientException, ServiceException {
          return internalRequestOperation.deleteBucketLogging(request, null).getResult();
      }
  
      @Override
      public OSSAsyncTask<DeleteBucketLoggingResult> asyncDeleteBucketLogging(DeleteBucketLoggingRequest request, OSSCompletedCallback<DeleteBucketLoggingRequest, DeleteBucketLoggingResult> completedCallback) {
          return internalRequestOperation.deleteBucketLogging(request, completedCallback);
      }
  
      @Override
      public PutBucketLoggingResult putBucketLogging(PutBucketLoggingRequest request) throws ClientException, ServiceException {
          return internalRequestOperation.putBucketLogging(request, null).getResult();
      }
  
      @Override
      public OSSAsyncTask<PutBucketLoggingResult> asyncPutBucketLogging(PutBucketLoggingRequest request, OSSCompletedCallback<PutBucketLoggingRequest, PutBucketLoggingResult> completedCallback) {
          return internalRequestOperation.putBucketLogging(request, completedCallback);
      }
  
      @Override
      public GetBucketLoggingResult getBucketLogging(GetBucketLoggingRequest request) throws ClientException, ServiceException {
          return internalRequestOperation.getBucketLogging(request, null).getResult();
      }
  
      @Override
      public OSSAsyncTask<GetBucketLoggingResult> asyncGetBucketLogging(GetBucketLoggingRequest request, OSSCompletedCallback<GetBucketLoggingRequest, GetBucketLoggingResult> completedCallback) {
          return internalRequestOperation.getBucketLogging(request, completedCallback);
      }
  
      @Override
      public PutBucketLifecycleResult putBucketLifecycle(PutBucketLifecycleRequest request) throws ClientException, ServiceException {
          return internalRequestOperation.putBucketLifecycle(request, null).getResult();
      }
  
      @Override
      public OSSAsyncTask<PutBucketLifecycleResult> asyncPutBucketLifecycle(PutBucketLifecycleRequest request, OSSCompletedCallback<PutBucketLifecycleRequest, PutBucketLifecycleResult> completedCallback) {
          return internalRequestOperation.putBucketLifecycle(request, completedCallback);
      }
  
      @Override
      public GetBucketLifecycleResult getBucketLifecycle(GetBucketLifecycleRequest request) throws ClientException, ServiceException {
          return internalRequestOperation.getBucketLifecycle(request, null).getResult();
      }
  
      @Override
      public OSSAsyncTask<GetBucketLifecycleResult> asyncGetBucketLifecycle(GetBucketLifecycleRequest request, OSSCompletedCallback<GetBucketLifecycleRequest, GetBucketLifecycleResult> completedCallback) {
          return internalRequestOperation.getBucketLifecycle(request, completedCallback);
      }
  
      @Override
      public DeleteBucketLifecycleResult deleteBucketLifecycle(DeleteBucketLifecycleRequest request) throws ClientException, ServiceException {
          return internalRequestOperation.deleteBucketLifecycle(request,null).getResult();
      }
  
      @Override
      public OSSAsyncTask<DeleteBucketLifecycleResult> asyncDeleteBucketLifecycle(DeleteBucketLifecycleRequest request, OSSCompletedCallback<DeleteBucketLifecycleRequest, DeleteBucketLifecycleResult> completedCallback) {
          return internalRequestOperation.deleteBucketLifecycle(request, completedCallback);
      }
  
      @Override
      public OSSAsyncTask<PutObjectResult> asyncPutObject(
              PutObjectRequest request, final OSSCompletedCallback<PutObjectRequest, PutObjectResult> completedCallback) {
          return internalRequestOperation.putObject(request, completedCallback);
      }
  
      @Override
      public PutObjectResult putObject(PutObjectRequest request)
              throws ClientException, ServiceException {
          return internalRequestOperation.syncPutObject(request);
      }
  
      @Override
      public OSSAsyncTask<GetObjectResult> asyncGetObject(
              GetObjectRequest request, final OSSCompletedCallback<GetObjectRequest, GetObjectResult> completedCallback) {
  
          return internalRequestOperation.getObject(request, completedCallback);
      }
  
      @Override
      public GetObjectResult getObject(GetObjectRequest request)
              throws ClientException, ServiceException {
  
          return internalRequestOperation.getObject(request, null).getResult();
      }
  
      @Override
      public OSSAsyncTask<GetObjectACLResult> asyncGetObjectACL(
              GetObjectACLRequest request, OSSCompletedCallback<GetObjectACLRequest, GetObjectACLResult> completedCallback) {
          return internalRequestOperation.getObjectACL(request, completedCallback);
      }
  
      @Override
      public GetObjectACLResult getObjectACL(GetObjectACLRequest request)
              throws ClientException, ServiceException {
  
          return internalRequestOperation.getObjectACL(request, null).getResult();
      }
  
      @Override
      public OSSAsyncTask<DeleteObjectResult> asyncDeleteObject(
              DeleteObjectRequest request, OSSCompletedCallback<DeleteObjectRequest, DeleteObjectResult> completedCallback) {
  
          return internalRequestOperation.deleteObject(request, completedCallback);
      }
  
      @Override
      public DeleteObjectResult deleteObject(DeleteObjectRequest request)
              throws ClientException, ServiceException {
  
          return internalRequestOperation.deleteObject(request, null).getResult();
      }
  
      @Override
      public OSSAsyncTask<DeleteMultipleObjectResult> asyncDeleteMultipleObject(
              DeleteMultipleObjectRequest request, OSSCompletedCallback<DeleteMultipleObjectRequest, DeleteMultipleObjectResult> completedCallback) {
  
          return internalRequestOperation.deleteMultipleObject(request, completedCallback);
      }
  
      @Override
      public DeleteMultipleObjectResult deleteMultipleObject(DeleteMultipleObjectRequest request)
              throws ClientException, ServiceException {
  
          return internalRequestOperation.deleteMultipleObject(request, null).getResult();
      }
  
      @Override
      public OSSAsyncTask<AppendObjectResult> asyncAppendObject(
              AppendObjectRequest request, final OSSCompletedCallback<AppendObjectRequest, AppendObjectResult> completedCallback) {
          return internalRequestOperation.appendObject(request, completedCallback);
      }
  
      @Override
      public AppendObjectResult appendObject(AppendObjectRequest request)
              throws ClientException, ServiceException {
          return internalRequestOperation.syncAppendObject(request);
      }
  
      @Override
      public OSSAsyncTask<HeadObjectResult> asyncHeadObject(HeadObjectRequest request, OSSCompletedCallback<HeadObjectRequest, HeadObjectResult> completedCallback) {
  
          return internalRequestOperation.headObject(request, completedCallback);
      }
  
      @Override
      public HeadObjectResult headObject(HeadObjectRequest request)
              throws ClientException, ServiceException {
  
          return internalRequestOperation.headObject(request, null).getResult();
      }
  
      @Override
      public OSSAsyncTask<GetObjectMetaResult> asyncGetObjectMeta(GetObjectMetaRequest request, OSSCompletedCallback<GetObjectMetaRequest, GetObjectMetaResult> completedCallback) {
          return internalRequestOperation.getObjectMeta(request, completedCallback);
      }
  
      @Override
      public GetObjectMetaResult getObjectMeta(GetObjectMetaRequest request) throws ClientException, ServiceException {
          return internalRequestOperation.getObjectMeta(request, null).getResult();
      }
  
      @Override
      public OSSAsyncTask<CopyObjectResult> asyncCopyObject(CopyObjectRequest request, OSSCompletedCallback<CopyObjectRequest, CopyObjectResult> completedCallback) {
  
          return internalRequestOperation.copyObject(request, completedCallback);
      }
  
      @Override
      public CopyObjectResult copyObject(CopyObjectRequest request)
              throws ClientException, ServiceException {
  
          return internalRequestOperation.copyObject(request, null).getResult();
      }
  
      @Override
      public OSSAsyncTask<ListObjectsResult> asyncListObjects(
              ListObjectsRequest request, OSSCompletedCallback<ListObjectsRequest, ListObjectsResult> completedCallback) {
  
          return internalRequestOperation.listObjects(request, completedCallback);
      }
  
      @Override
      public ListObjectsResult listObjects(ListObjectsRequest request)
              throws ClientException, ServiceException {
  
          return internalRequestOperation.listObjects(request, null).getResult();
      }
  
      @Override
      public OSSAsyncTask<InitiateMultipartUploadResult> asyncInitMultipartUpload(InitiateMultipartUploadRequest request, OSSCompletedCallback<InitiateMultipartUploadRequest, InitiateMultipartUploadResult> completedCallback) {
  
          return internalRequestOperation.initMultipartUpload(request, completedCallback);
      }
  
      @Override
      public InitiateMultipartUploadResult initMultipartUpload(InitiateMultipartUploadRequest request)
              throws ClientException, ServiceException {
  
          return internalRequestOperation.initMultipartUpload(request, null).getResult();
      }
  
      @Override
      public OSSAsyncTask<UploadPartResult> asyncUploadPart(UploadPartRequest request, final OSSCompletedCallback<UploadPartRequest, UploadPartResult> completedCallback) {
  
          return internalRequestOperation.uploadPart(request, completedCallback);
      }
  
      @Override
      public UploadPartResult uploadPart(UploadPartRequest request)
              throws ClientException, ServiceException {
          return internalRequestOperation.syncUploadPart(request);
      }
  
      @Override
      public OSSAsyncTask<CompleteMultipartUploadResult> asyncCompleteMultipartUpload(CompleteMultipartUploadRequest request
              , final OSSCompletedCallback<CompleteMultipartUploadRequest, CompleteMultipartUploadResult> completedCallback) {
  
          return internalRequestOperation.completeMultipartUpload(request, completedCallback);
      }
  
      @Override
      public CompleteMultipartUploadResult completeMultipartUpload(CompleteMultipartUploadRequest request)
              throws ClientException, ServiceException {
          return internalRequestOperation.syncCompleteMultipartUpload(request);
      }
  
  
      @Override
      public OSSAsyncTask<AbortMultipartUploadResult> asyncAbortMultipartUpload(AbortMultipartUploadRequest request, OSSCompletedCallback<AbortMultipartUploadRequest, AbortMultipartUploadResult> completedCallback) {
  
          return internalRequestOperation.abortMultipartUpload(request, completedCallback);
      }
  
      @Override
      public AbortMultipartUploadResult abortMultipartUpload(AbortMultipartUploadRequest request)
              throws ClientException, ServiceException {
  
          return internalRequestOperation.abortMultipartUpload(request, null).getResult();
      }
  
      @Override
      public OSSAsyncTask<ListPartsResult> asyncListParts(ListPartsRequest request, OSSCompletedCallback<ListPartsRequest, ListPartsResult> completedCallback) {
  
          return internalRequestOperation.listParts(request, completedCallback);
      }
  
      @Override
      public ListPartsResult listParts(ListPartsRequest request)
              throws ClientException, ServiceException {
  
          return internalRequestOperation.listParts(request, null).getResult();
      }
  
      @Override
      public OSSAsyncTask<ListMultipartUploadsResult> asyncListMultipartUploads(ListMultipartUploadsRequest request, OSSCompletedCallback<ListMultipartUploadsRequest, ListMultipartUploadsResult> completedCallback) {
          return internalRequestOperation.listMultipartUploads(request, completedCallback);
      }
  
      @Override
      public ListMultipartUploadsResult listMultipartUploads(ListMultipartUploadsRequest request) throws ClientException, ServiceException {
          return internalRequestOperation.listMultipartUploads(request, null).getResult();
      }
  
      @Override
      public void updateCredentialProvider(OSSCredentialProvider credentialProvider) {
          this.credentialProvider = credentialProvider;
          internalRequestOperation.setCredentialProvider(credentialProvider);
      }
  
      @Override
      public OSSAsyncTask<CompleteMultipartUploadResult> asyncMultipartUpload(
              MultipartUploadRequest request, OSSCompletedCallback<MultipartUploadRequest, CompleteMultipartUploadResult> completedCallback) {
  
          return extensionRequestOperation.multipartUpload(request, completedCallback);
      }
  
      @Override
      public CompleteMultipartUploadResult multipartUpload(MultipartUploadRequest request)
              throws ClientException, ServiceException {
  
          return extensionRequestOperation.multipartUpload(request, null).getResult();
      }
  
      @Override
      public OSSAsyncTask<ResumableUploadResult> asyncResumableUpload(
              ResumableUploadRequest request, OSSCompletedCallback<ResumableUploadRequest, ResumableUploadResult> completedCallback) {
  
          return extensionRequestOperation.resumableUpload(request, completedCallback);
      }
  
      @Override
      public ResumableUploadResult resumableUpload(ResumableUploadRequest request)
              throws ClientException, ServiceException {
  
          return extensionRequestOperation.resumableUpload(request, null).getResult();
      }
  
      @Override
      public OSSAsyncTask<ResumableUploadResult> asyncSequenceUpload(
              ResumableUploadRequest request, OSSCompletedCallback<ResumableUploadRequest, ResumableUploadResult> completedCallback) {
  
          return extensionRequestOperation.sequenceUpload(request, completedCallback);
      }
  
  
      @Override
      public ResumableUploadResult sequenceUpload(ResumableUploadRequest request)
              throws ClientException, ServiceException {
  
          return extensionRequestOperation.sequenceUpload(request, null).getResult();
      }
  
      @Override
      public String presignConstrainedObjectURL(GeneratePresignedUrlRequest request) throws ClientException {
          return objectURLPresigner.presignConstrainedURL(request);
      }
  
      @Override
      public String presignConstrainedObjectURL(String bucketName, String objectKey, long expiredTimeInSeconds)
              throws ClientException {
  
          return objectURLPresigner.presignConstrainedURL(bucketName, objectKey, expiredTimeInSeconds);
      }
  
      @Override
      public String presignPublicObjectURL(String bucketName, String objectKey) {
  
          return objectURLPresigner.presignPublicURL(bucketName, objectKey);
      }
  
      @Override
      public boolean doesObjectExist(String bucketName, String objectKey)
              throws ClientException, ServiceException {
  
          return extensionRequestOperation.doesObjectExist(bucketName, objectKey);
      }
  
      @Override
      public void abortResumableUpload(ResumableUploadRequest request) throws IOException {
  
          extensionRequestOperation.abortResumableUpload(request);
      }
  
      @Override
      public OSSAsyncTask<TriggerCallbackResult> asyncTriggerCallback(TriggerCallbackRequest request, OSSCompletedCallback<TriggerCallbackRequest, TriggerCallbackResult> completedCallback) {
          return internalRequestOperation.triggerCallback(request, completedCallback);
      }
  
      @Override
      public TriggerCallbackResult triggerCallback(TriggerCallbackRequest request) throws ClientException, ServiceException {
          return internalRequestOperation.asyncTriggerCallback(request);
      }
  
      @Override
      public OSSAsyncTask<ImagePersistResult> asyncImagePersist(ImagePersistRequest request, OSSCompletedCallback<ImagePersistRequest, ImagePersistResult> completedCallback) {
          return internalRequestOperation.imageActionPersist(request, completedCallback);
      }
  
      @Override
      public ImagePersistResult imagePersist(ImagePersistRequest request) throws ClientException, ServiceException {
          return internalRequestOperation.imageActionPersist(request, null).getResult();
      }
  
      @Override
      public PutSymlinkResult putSymlink(PutSymlinkRequest request) throws ClientException, ServiceException {
          return internalRequestOperation.syncPutSymlink(request);
      }
  
      @Override
      public OSSAsyncTask<PutSymlinkResult> asyncPutSymlink(PutSymlinkRequest request, OSSCompletedCallback<PutSymlinkRequest, PutSymlinkResult> completedCallback) {
          return internalRequestOperation.putSymlink(request, completedCallback);
      }
  
      @Override
      public GetSymlinkResult getSymlink(GetSymlinkRequest request) throws ClientException, ServiceException {
          return internalRequestOperation.syncGetSymlink(request);
      }
  
      @Override
      public OSSAsyncTask<GetSymlinkResult> asyncGetSymlink(GetSymlinkRequest request, OSSCompletedCallback<GetSymlinkRequest, GetSymlinkResult> completedCallback) {
          return internalRequestOperation.getSymlink(request, completedCallback);
      }
  
      @Override
      public RestoreObjectResult restoreObject(RestoreObjectRequest request) throws ClientException, ServiceException {
          return internalRequestOperation.syncRestoreObject(request);
      }
  
      @Override
      public OSSAsyncTask<RestoreObjectResult> asyncRestoreObject(RestoreObjectRequest request, OSSCompletedCallback<RestoreObjectRequest, RestoreObjectResult> completedCallback) {
          return internalRequestOperation.restoreObject(request, completedCallback);
      }
  
      @Override
      public OSSAsyncTask<ResumableDownloadResult> asyncResumableDownload(ResumableDownloadRequest request, OSSCompletedCallback<ResumableDownloadRequest, ResumableDownloadResult> completedCallback) {
          return extensionRequestOperation.resumableDownload(request, completedCallback);
      }
  
      @Override
      public ResumableDownloadResult syncResumableDownload(ResumableDownloadRequest request) throws ClientException, ServiceException {
          return extensionRequestOperation.resumableDownload(request, null).getResult();
      }
  
  
      @Override
      public PutObjectTaggingResult putObjectTagging(PutObjectTaggingRequest request) throws ClientException, ServiceException {
          return internalRequestOperation.syncPutObjectTagging(request);
      }
  
      @Override
      public OSSAsyncTask<PutObjectTaggingResult> asyncPutObjectTagging(PutObjectTaggingRequest request, OSSCompletedCallback<PutObjectTaggingRequest, PutObjectTaggingResult> completedCallback) {
          return internalRequestOperation.putObjectTagging(request, completedCallback);
      }
  
      @Override
      public GetObjectTaggingResult getObjectTagging(GetObjectTaggingRequest request) throws ClientException, ServiceException {
          return internalRequestOperation.syncGetObjectTagging(request);
      }
  
      @Override
      public OSSAsyncTask<GetObjectTaggingResult> asyncGetObjectTagging(GetObjectTaggingRequest request, OSSCompletedCallback<GetObjectTaggingRequest, GetObjectTaggingResult> completedCallback) {
          return internalRequestOperation.getObjectTagging(request, completedCallback);
      }
  
      @Override
      public DeleteObjectTaggingResult deleteObjectTagging(DeleteObjectTaggingRequest request) throws ClientException, ServiceException {
          return internalRequestOperation.syncDeleteObjectTagging(request);
      }
  
      @Override
      public OSSAsyncTask<DeleteObjectTaggingResult> asyncDeleteObjectTagging(DeleteObjectTaggingRequest request, OSSCompletedCallback<DeleteObjectTaggingRequest, DeleteObjectTaggingResult> completedCallback) {
          return internalRequestOperation.deleteObjectTagging(request, completedCallback);
      }
  
  }
  