當前位置: 首頁>>代碼示例>>Java>>正文


Java ObjectMetadata.setSSEAlgorithm方法代碼示例

本文整理匯總了Java中com.amazonaws.services.s3.model.ObjectMetadata.setSSEAlgorithm方法的典型用法代碼示例。如果您正苦於以下問題:Java ObjectMetadata.setSSEAlgorithm方法的具體用法?Java ObjectMetadata.setSSEAlgorithm怎麽用?Java ObjectMetadata.setSSEAlgorithm使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.amazonaws.services.s3.model.ObjectMetadata的用法示例。


在下文中一共展示了ObjectMetadata.setSSEAlgorithm方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: move

import com.amazonaws.services.s3.model.ObjectMetadata; //導入方法依賴的package包/類
@Override
public void move(String sourceBlobName, String targetBlobName) throws IOException {
    try {
        CopyObjectRequest request = new CopyObjectRequest(blobStore.bucket(), buildKey(sourceBlobName),
            blobStore.bucket(), buildKey(targetBlobName));

        if (blobStore.serverSideEncryption()) {
            ObjectMetadata objectMetadata = new ObjectMetadata();
            objectMetadata.setSSEAlgorithm(ObjectMetadata.AES_256_SERVER_SIDE_ENCRYPTION);
            request.setNewObjectMetadata(objectMetadata);
        }

        SocketAccess.doPrivilegedVoid(() -> {
            blobStore.client().copyObject(request);
            blobStore.client().deleteObject(blobStore.bucket(), buildKey(sourceBlobName));
        });

    } catch (AmazonS3Exception e) {
        throw new IOException(e);
    }
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:22,代碼來源:S3BlobContainer.java

示例2: doInitialize

import com.amazonaws.services.s3.model.ObjectMetadata; //導入方法依賴的package包/類
protected String doInitialize(S3BlobStore blobStore, String bucketName, String blobName, boolean serverSideEncryption) {
    InitiateMultipartUploadRequest request = new InitiateMultipartUploadRequest(bucketName, blobName)
            .withCannedACL(blobStore.getCannedACL())
            .withStorageClass(blobStore.getStorageClass());

    if (serverSideEncryption) {
        ObjectMetadata md = new ObjectMetadata();
        md.setSSEAlgorithm(ObjectMetadata.AES_256_SERVER_SIDE_ENCRYPTION);
        request.setObjectMetadata(md);
    }

    return blobStore.client().initiateMultipartUpload(request).getUploadId();
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:14,代碼來源:DefaultS3OutputStream.java

示例3: describeUpload

import com.amazonaws.services.s3.model.ObjectMetadata; //導入方法依賴的package包/類
private S3UploadDescriptor describeUpload(FileStatus sourceFileStatus, Path targetPath) throws IOException {
  URI targetUri = targetPath.toUri();
  String bucketName = PathUtil.toBucketName(targetUri);
  String key = PathUtil.toBucketKey(targetUri);

  Path sourcePath = sourceFileStatus.getPath();

  ObjectMetadata metadata = new ObjectMetadata();
  metadata.setContentLength(sourceFileStatus.getLen());
  if (conf.getBoolean(ConfigurationVariable.S3_SERVER_SIDE_ENCRYPTION)) {
    metadata.setSSEAlgorithm(ObjectMetadata.AES_256_SERVER_SIDE_ENCRYPTION);
  }
  return new S3UploadDescriptor(sourcePath, bucketName, key, metadata);
}
 
開發者ID:HotelsDotCom,項目名稱:circus-train,代碼行數:15,代碼來源:CopyMapper.java


注:本文中的com.amazonaws.services.s3.model.ObjectMetadata.setSSEAlgorithm方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。