本文整理汇总了Java中com.amazonaws.Request类的典型用法代码示例。如果您正苦于以下问题:Java Request类的具体用法?Java Request怎么用?Java Request使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Request类属于com.amazonaws包,在下文中一共展示了Request类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: listObjects
import com.amazonaws.Request; //导入依赖的package包/类
@Override
public ObjectListing listObjects(ListObjectsRequest listObjectsRequest)
throws SdkClientException, AmazonServiceException {
listObjectsRequest = beforeClientExecution(listObjectsRequest);
rejectNull(listObjectsRequest.getBucketName(), "The bucket name parameter must be specified when listing objects in a bucket");
/**
* This flag shows whether we need to url decode S3 key names. This flag is enabled
* only when the customers don't explicitly call {@link ListObjectsRequest#setEncodingType(String)},
* otherwise, it will be disabled for maintaining backwards compatibility.
*/
final boolean shouldSDKDecodeResponse = listObjectsRequest.getEncodingType() == null;
Request<ListObjectsRequest> request = createRequest(listObjectsRequest.getBucketName(), null, listObjectsRequest, HttpMethodName.GET);
addParameterIfNotNull(request, "prefix", listObjectsRequest.getPrefix());
addParameterIfNotNull(request, "marker", listObjectsRequest.getMarker());
addParameterIfNotNull(request, "delimiter", listObjectsRequest.getDelimiter());
if (listObjectsRequest.getMaxKeys() != null && listObjectsRequest.getMaxKeys().intValue() >= 0) request.addParameter("max-keys", listObjectsRequest.getMaxKeys().toString());
request.addParameter("encoding-type", shouldSDKDecodeResponse ? Constants.URL_ENCODING : listObjectsRequest.getEncodingType());
return invoke(request, new Unmarshallers.ListObjectsUnmarshaller(shouldSDKDecodeResponse), listObjectsRequest.getBucketName(), null);
}
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:23,代码来源:AmazonS3Client.java
示例2: getBucketRequestPayment
import com.amazonaws.Request; //导入依赖的package包/类
/**
* Retrieves the request payment configuration for a given Amazon S3 bucket.
* <p>
* When the request payment configuration for a Amazon S3 bucket is
* <code>Requester</code>, the requester instead of the bucket owner pays
* the cost of the request and the data download from the bucket. The bucket
* owner always pays the cost of storing data.
*/
private RequestPaymentConfiguration getBucketRequestPayment(
GetRequestPaymentConfigurationRequest getRequestPaymentConfigurationRequest) {
String bucketName = getRequestPaymentConfigurationRequest
.getBucketName();
rejectNull(
bucketName,
"The bucket name parameter must be specified while getting the Request Payment Configuration.");
Request<GetRequestPaymentConfigurationRequest> request = createRequest(
bucketName, null, getRequestPaymentConfigurationRequest,
HttpMethodName.GET);
request.addParameter("requestPayment", null);
request.addHeader("Content-Type", "application/xml");
return invoke(request,
new Unmarshallers.RequestPaymentConfigurationUnmarshaller(),
bucketName, null);
}
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:29,代码来源:AmazonS3Client.java
示例3: marshall
import com.amazonaws.Request; //导入依赖的package包/类
public Request<EncryptRequest> marshall(EncryptRequest encryptRequest) {
if (encryptRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
final ProtocolRequestMarshaller<EncryptRequest> protocolMarshaller = protocolFactory
.createProtocolMarshaller(SDK_OPERATION_BINDING, encryptRequest);
protocolMarshaller.startMarshalling();
EncryptRequestMarshaller.getInstance().marshall(encryptRequest, protocolMarshaller);
return protocolMarshaller.finishMarshalling();
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
}
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:18,代码来源:EncryptRequestProtocolMarshaller.java
示例4: marshall
import com.amazonaws.Request; //导入依赖的package包/类
public Request<ListRetirableGrantsRequest> marshall(ListRetirableGrantsRequest listRetirableGrantsRequest) {
if (listRetirableGrantsRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
final ProtocolRequestMarshaller<ListRetirableGrantsRequest> protocolMarshaller = protocolFactory.createProtocolMarshaller(SDK_OPERATION_BINDING,
listRetirableGrantsRequest);
protocolMarshaller.startMarshalling();
ListRetirableGrantsRequestMarshaller.getInstance().marshall(listRetirableGrantsRequest, protocolMarshaller);
return protocolMarshaller.finishMarshalling();
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
}
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:18,代码来源:ListRetirableGrantsRequestProtocolMarshaller.java
示例5: marshall
import com.amazonaws.Request; //导入依赖的package包/类
public Request<GenerateDataKeyRequest> marshall(GenerateDataKeyRequest generateDataKeyRequest) {
if (generateDataKeyRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
final ProtocolRequestMarshaller<GenerateDataKeyRequest> protocolMarshaller = protocolFactory.createProtocolMarshaller(SDK_OPERATION_BINDING,
generateDataKeyRequest);
protocolMarshaller.startMarshalling();
GenerateDataKeyRequestMarshaller.getInstance().marshall(generateDataKeyRequest, protocolMarshaller);
return protocolMarshaller.finishMarshalling();
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
}
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:18,代码来源:GenerateDataKeyRequestProtocolMarshaller.java
示例6: marshall
import com.amazonaws.Request; //导入依赖的package包/类
public Request<ListKeyPoliciesRequest> marshall(ListKeyPoliciesRequest listKeyPoliciesRequest) {
if (listKeyPoliciesRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
final ProtocolRequestMarshaller<ListKeyPoliciesRequest> protocolMarshaller = protocolFactory.createProtocolMarshaller(SDK_OPERATION_BINDING,
listKeyPoliciesRequest);
protocolMarshaller.startMarshalling();
ListKeyPoliciesRequestMarshaller.getInstance().marshall(listKeyPoliciesRequest, protocolMarshaller);
return protocolMarshaller.finishMarshalling();
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
}
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:18,代码来源:ListKeyPoliciesRequestProtocolMarshaller.java
示例7: deleteBucketTaggingConfiguration
import com.amazonaws.Request; //导入依赖的package包/类
@Override
public void deleteBucketTaggingConfiguration(
DeleteBucketTaggingConfigurationRequest deleteBucketTaggingConfigurationRequest) {
deleteBucketTaggingConfigurationRequest = beforeClientExecution(deleteBucketTaggingConfigurationRequest);
rejectNull(deleteBucketTaggingConfigurationRequest,
"The delete bucket tagging configuration request object must be specified.");
String bucketName = deleteBucketTaggingConfigurationRequest.getBucketName();
rejectNull(bucketName,
"The bucket name parameter must be specified when deleting bucket tagging configuration.");
Request<DeleteBucketTaggingConfigurationRequest> request = createRequest(bucketName, null, deleteBucketTaggingConfigurationRequest, HttpMethodName.DELETE);
request.addParameter("tagging", null);
invoke(request, voidResponseHandler, bucketName, null);
}
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:17,代码来源:AmazonS3Client.java
示例8: marshall
import com.amazonaws.Request; //导入依赖的package包/类
public Request<PutKeyPolicyRequest> marshall(PutKeyPolicyRequest putKeyPolicyRequest) {
if (putKeyPolicyRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
final ProtocolRequestMarshaller<PutKeyPolicyRequest> protocolMarshaller = protocolFactory.createProtocolMarshaller(SDK_OPERATION_BINDING,
putKeyPolicyRequest);
protocolMarshaller.startMarshalling();
PutKeyPolicyRequestMarshaller.getInstance().marshall(putKeyPolicyRequest, protocolMarshaller);
return protocolMarshaller.finishMarshalling();
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
}
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:18,代码来源:PutKeyPolicyRequestProtocolMarshaller.java
示例9: populateSourceSSE_C
import com.amazonaws.Request; //导入依赖的package包/类
private static void populateSourceSSE_C(Request<?> request, SSECustomerKey sseKey) {
if (sseKey == null) return;
// Populate the SSE-C parameters for the source object
addHeaderIfNotNull(request, Headers.COPY_SOURCE_SERVER_SIDE_ENCRYPTION_CUSTOMER_ALGORITHM,
sseKey.getAlgorithm());
addHeaderIfNotNull(request, Headers.COPY_SOURCE_SERVER_SIDE_ENCRYPTION_CUSTOMER_KEY,
sseKey.getKey());
addHeaderIfNotNull(request, Headers.COPY_SOURCE_SERVER_SIDE_ENCRYPTION_CUSTOMER_KEY_MD5,
sseKey.getMd5());
// Calculate the MD5 hash of the encryption key and fill it in the
// header, if the user didn't specify it in the metadata
if (sseKey.getKey() != null
&& sseKey.getMd5() == null) {
String encryptionKey_b64 = sseKey.getKey();
byte[] encryptionKey = Base64.decode(encryptionKey_b64);
request.addHeader(Headers.COPY_SOURCE_SERVER_SIDE_ENCRYPTION_CUSTOMER_KEY_MD5,
Md5Utils.md5AsBase64(encryptionKey));
}
}
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:21,代码来源:AmazonS3Client.java
示例10: listMultipartUploads
import com.amazonaws.Request; //导入依赖的package包/类
@Override
public MultipartUploadListing listMultipartUploads(ListMultipartUploadsRequest listMultipartUploadsRequest)
throws SdkClientException, AmazonServiceException {
listMultipartUploadsRequest = beforeClientExecution(listMultipartUploadsRequest);
rejectNull(listMultipartUploadsRequest,
"The request parameter must be specified when listing multipart uploads");
rejectNull(listMultipartUploadsRequest.getBucketName(),
"The bucket name parameter must be specified when listing multipart uploads");
Request<ListMultipartUploadsRequest> request = createRequest(listMultipartUploadsRequest.getBucketName(), null, listMultipartUploadsRequest, HttpMethodName.GET);
request.addParameter("uploads", null);
if (listMultipartUploadsRequest.getKeyMarker() != null) request.addParameter("key-marker", listMultipartUploadsRequest.getKeyMarker());
if (listMultipartUploadsRequest.getMaxUploads() != null) request.addParameter("max-uploads", listMultipartUploadsRequest.getMaxUploads().toString());
if (listMultipartUploadsRequest.getUploadIdMarker() != null) request.addParameter("upload-id-marker", listMultipartUploadsRequest.getUploadIdMarker());
if (listMultipartUploadsRequest.getDelimiter() != null) request.addParameter("delimiter", listMultipartUploadsRequest.getDelimiter());
if (listMultipartUploadsRequest.getPrefix() != null) request.addParameter("prefix", listMultipartUploadsRequest.getPrefix());
if (listMultipartUploadsRequest.getEncodingType() != null) request.addParameter("encoding-type", listMultipartUploadsRequest.getEncodingType());
return invoke(request, new Unmarshallers.ListMultipartUploadsResultUnmarshaller(), listMultipartUploadsRequest.getBucketName(), null);
}
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:23,代码来源:AmazonS3Client.java
示例11: marshall
import com.amazonaws.Request; //导入依赖的package包/类
public Request<DisableKeyRequest> marshall(DisableKeyRequest disableKeyRequest) {
if (disableKeyRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
final ProtocolRequestMarshaller<DisableKeyRequest> protocolMarshaller = protocolFactory.createProtocolMarshaller(SDK_OPERATION_BINDING,
disableKeyRequest);
protocolMarshaller.startMarshalling();
DisableKeyRequestMarshaller.getInstance().marshall(disableKeyRequest, protocolMarshaller);
return protocolMarshaller.finishMarshalling();
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
}
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:18,代码来源:DisableKeyRequestProtocolMarshaller.java
示例12: marshall
import com.amazonaws.Request; //导入依赖的package包/类
public Request<GetKeyRotationStatusRequest> marshall(GetKeyRotationStatusRequest getKeyRotationStatusRequest) {
if (getKeyRotationStatusRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
final ProtocolRequestMarshaller<GetKeyRotationStatusRequest> protocolMarshaller = protocolFactory.createProtocolMarshaller(SDK_OPERATION_BINDING,
getKeyRotationStatusRequest);
protocolMarshaller.startMarshalling();
GetKeyRotationStatusRequestMarshaller.getInstance().marshall(getKeyRotationStatusRequest, protocolMarshaller);
return protocolMarshaller.finishMarshalling();
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
}
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:18,代码来源:GetKeyRotationStatusRequestProtocolMarshaller.java
示例13: marshall
import com.amazonaws.Request; //导入依赖的package包/类
public Request<EnableKeyRequest> marshall(EnableKeyRequest enableKeyRequest) {
if (enableKeyRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
final ProtocolRequestMarshaller<EnableKeyRequest> protocolMarshaller = protocolFactory.createProtocolMarshaller(SDK_OPERATION_BINDING,
enableKeyRequest);
protocolMarshaller.startMarshalling();
EnableKeyRequestMarshaller.getInstance().marshall(enableKeyRequest, protocolMarshaller);
return protocolMarshaller.finishMarshalling();
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
}
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:18,代码来源:EnableKeyRequestProtocolMarshaller.java
示例14: marshall
import com.amazonaws.Request; //导入依赖的package包/类
public Request<CancelKeyDeletionRequest> marshall(CancelKeyDeletionRequest cancelKeyDeletionRequest) {
if (cancelKeyDeletionRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
final ProtocolRequestMarshaller<CancelKeyDeletionRequest> protocolMarshaller = protocolFactory.createProtocolMarshaller(SDK_OPERATION_BINDING,
cancelKeyDeletionRequest);
protocolMarshaller.startMarshalling();
CancelKeyDeletionRequestMarshaller.getInstance().marshall(cancelKeyDeletionRequest, protocolMarshaller);
return protocolMarshaller.finishMarshalling();
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
}
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:18,代码来源:CancelKeyDeletionRequestProtocolMarshaller.java
示例15: marshall
import com.amazonaws.Request; //导入依赖的package包/类
public Request<GetKeyPolicyRequest> marshall(GetKeyPolicyRequest getKeyPolicyRequest) {
if (getKeyPolicyRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
final ProtocolRequestMarshaller<GetKeyPolicyRequest> protocolMarshaller = protocolFactory.createProtocolMarshaller(SDK_OPERATION_BINDING,
getKeyPolicyRequest);
protocolMarshaller.startMarshalling();
GetKeyPolicyRequestMarshaller.getInstance().marshall(getKeyPolicyRequest, protocolMarshaller);
return protocolMarshaller.finishMarshalling();
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
}
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:18,代码来源:GetKeyPolicyRequestProtocolMarshaller.java
示例16: marshall
import com.amazonaws.Request; //导入依赖的package包/类
public Request<ReEncryptRequest> marshall(ReEncryptRequest reEncryptRequest) {
if (reEncryptRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
final ProtocolRequestMarshaller<ReEncryptRequest> protocolMarshaller = protocolFactory.createProtocolMarshaller(SDK_OPERATION_BINDING,
reEncryptRequest);
protocolMarshaller.startMarshalling();
ReEncryptRequestMarshaller.getInstance().marshall(reEncryptRequest, protocolMarshaller);
return protocolMarshaller.finishMarshalling();
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
}
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:18,代码来源:ReEncryptRequestProtocolMarshaller.java
示例17: marshall
import com.amazonaws.Request; //导入依赖的package包/类
public Request<RetireGrantRequest> marshall(RetireGrantRequest retireGrantRequest) {
if (retireGrantRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
final ProtocolRequestMarshaller<RetireGrantRequest> protocolMarshaller = protocolFactory.createProtocolMarshaller(SDK_OPERATION_BINDING,
retireGrantRequest);
protocolMarshaller.startMarshalling();
RetireGrantRequestMarshaller.getInstance().marshall(retireGrantRequest, protocolMarshaller);
return protocolMarshaller.finishMarshalling();
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
}
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:18,代码来源:RetireGrantRequestProtocolMarshaller.java
示例18: marshall
import com.amazonaws.Request; //导入依赖的package包/类
public Request<ImportKeyMaterialRequest> marshall(ImportKeyMaterialRequest importKeyMaterialRequest) {
if (importKeyMaterialRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
final ProtocolRequestMarshaller<ImportKeyMaterialRequest> protocolMarshaller = protocolFactory.createProtocolMarshaller(SDK_OPERATION_BINDING,
importKeyMaterialRequest);
protocolMarshaller.startMarshalling();
ImportKeyMaterialRequestMarshaller.getInstance().marshall(importKeyMaterialRequest, protocolMarshaller);
return protocolMarshaller.finishMarshalling();
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
}
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:18,代码来源:ImportKeyMaterialRequestProtocolMarshaller.java
示例19: marshall
import com.amazonaws.Request; //导入依赖的package包/类
public Request<DeleteImportedKeyMaterialRequest> marshall(DeleteImportedKeyMaterialRequest deleteImportedKeyMaterialRequest) {
if (deleteImportedKeyMaterialRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
final ProtocolRequestMarshaller<DeleteImportedKeyMaterialRequest> protocolMarshaller = protocolFactory.createProtocolMarshaller(
SDK_OPERATION_BINDING, deleteImportedKeyMaterialRequest);
protocolMarshaller.startMarshalling();
DeleteImportedKeyMaterialRequestMarshaller.getInstance().marshall(deleteImportedKeyMaterialRequest, protocolMarshaller);
return protocolMarshaller.finishMarshalling();
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
}
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:18,代码来源:DeleteImportedKeyMaterialRequestProtocolMarshaller.java
示例20: marshall
import com.amazonaws.Request; //导入依赖的package包/类
public Request<ListGrantsRequest> marshall(ListGrantsRequest listGrantsRequest) {
if (listGrantsRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
final ProtocolRequestMarshaller<ListGrantsRequest> protocolMarshaller = protocolFactory.createProtocolMarshaller(SDK_OPERATION_BINDING,
listGrantsRequest);
protocolMarshaller.startMarshalling();
ListGrantsRequestMarshaller.getInstance().marshall(listGrantsRequest, protocolMarshaller);
return protocolMarshaller.finishMarshalling();
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
}
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:18,代码来源:ListGrantsRequestProtocolMarshaller.java
注:本文中的com.amazonaws.Request类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论