• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java SetObjectAclRequest类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中com.amazonaws.services.s3.model.SetObjectAclRequest的典型用法代码示例。如果您正苦于以下问题:Java SetObjectAclRequest类的具体用法?Java SetObjectAclRequest怎么用?Java SetObjectAclRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

SetObjectAclRequest类属于com.amazonaws.services.s3.model包,在下文中一共展示了SetObjectAclRequest类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: setObjectAcl

点赞 2

import com.amazonaws.services.s3.model.SetObjectAclRequest; //导入依赖的package包/类
/**
 * Same as {@link #setObjectAcl(String, String, String, AccessControlList)}
 * but allows specifying a request metric collector.
 */
public void setObjectAcl(String bucketName, String key, String versionId,
        AccessControlList acl, RequestMetricCollector requestMetricCollector)
        throws SdkClientException, AmazonServiceException {
    setObjectAcl(new SetObjectAclRequest(bucketName, key, versionId, acl)
            .<SetObjectAclRequest> withRequestMetricCollector(requestMetricCollector));
}
 

开发者ID:IBM,
项目名称:ibm-cos-sdk-java
代码行数:11,
代码来源:AmazonS3Client.java

示例2: setObjectAcl

点赞 2

import com.amazonaws.services.s3.model.SetObjectAclRequest; //导入依赖的package包/类
@Override
public void setObjectAcl(SetObjectAclRequest setObjectAclRequest) throws AmazonClientException, AmazonServiceException {
    delegate.setObjectAcl(setObjectAclRequest);
}
 

开发者ID:justor,
项目名称:elasticsearch_my,
代码行数:5,
代码来源:AmazonS3Wrapper.java

示例3: setObjectAcl

点赞 2

import com.amazonaws.services.s3.model.SetObjectAclRequest; //导入依赖的package包/类
@Override
public void setObjectAcl(SetObjectAclRequest setObjectAclRequest) throws SdkClientException, AmazonServiceException {
  run(() -> getDelegate().setObjectAcl(setObjectAclRequest));
}
 

开发者ID:HubSpot,
项目名称:S3Decorators,
代码行数:5,
代码来源:S3Decorator.java

示例4: test

点赞 2

import com.amazonaws.services.s3.model.SetObjectAclRequest; //导入依赖的package包/类
@Test
@Override
public void test() throws Exception {
	AmazonS3 amazonS3Client = TestUtils.getPropertyValue(this.s3MessageHandler, "transferManager.s3",
			AmazonS3.class);

	File file = this.temporaryFolder.newFile("foo.mp3");
	Message<?> message = MessageBuilder.withPayload(file)
			.build();

	this.channels.input().send(message);

	ArgumentCaptor<PutObjectRequest> putObjectRequestArgumentCaptor =
			ArgumentCaptor.forClass(PutObjectRequest.class);
	verify(amazonS3Client, atLeastOnce()).putObject(putObjectRequestArgumentCaptor.capture());

	PutObjectRequest putObjectRequest = putObjectRequestArgumentCaptor.getValue();
	assertThat(putObjectRequest.getBucketName(), equalTo(S3_BUCKET));
	assertThat(putObjectRequest.getKey(), equalTo("foo.mp3"));
	assertNotNull(putObjectRequest.getFile());
	assertNull(putObjectRequest.getInputStream());

	ObjectMetadata metadata = putObjectRequest.getMetadata();
	assertThat(metadata.getContentMD5(), equalTo(Md5Utils.md5AsBase64(file)));
	assertThat(metadata.getContentLength(), equalTo(0L));
	assertThat(metadata.getContentType(), equalTo("audio/mpeg"));

	ProgressListener listener = putObjectRequest.getGeneralProgressListener();
	S3ProgressPublisher.publishProgress(listener, ProgressEventType.TRANSFER_COMPLETED_EVENT);

	assertTrue(this.transferCompletedLatch.await(10, TimeUnit.SECONDS));
	assertTrue(this.aclLatch.await(10, TimeUnit.SECONDS));

	ArgumentCaptor<SetObjectAclRequest> setObjectAclRequestArgumentCaptor =
			ArgumentCaptor.forClass(SetObjectAclRequest.class);
	verify(amazonS3Client).setObjectAcl(setObjectAclRequestArgumentCaptor.capture());

	SetObjectAclRequest setObjectAclRequest = setObjectAclRequestArgumentCaptor.getValue();

	assertThat(setObjectAclRequest.getBucketName(), equalTo(S3_BUCKET));
	assertThat(setObjectAclRequest.getKey(), equalTo("foo.mp3"));
	assertNull(setObjectAclRequest.getAcl());
	assertThat(setObjectAclRequest.getCannedAcl(), equalTo(CannedAccessControlList.PublicReadWrite));
}
 

开发者ID:spring-cloud,
项目名称:spring-cloud-stream-app-starters,
代码行数:45,
代码来源:AmazonS3SinkMockTests.java

示例5: setObjectAcl

点赞 2

import com.amazonaws.services.s3.model.SetObjectAclRequest; //导入依赖的package包/类
@Override
public void setObjectAcl(SetObjectAclRequest setObjectAclRequest)
        throws AmazonClientException
{
}
 

开发者ID:y-lan,
项目名称:presto,
代码行数:6,
代码来源:MockAmazonS3.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)