public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) { AbortMultipartUploadResponse response = new AbortMultipartUploadResponse(); return(response); }
public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) { AbortMultipartUploadResponse abortMultipartUploadResponse = new AbortMultipartUploadResponse(); IWebResponseData responseData = context.get_ResponseData(); if (responseData.IsHeaderPresent(S3Constants.AmzHeaderRequestCharged)) { abortMultipartUploadResponse.RequestCharged = RequestCharged.FindValue(responseData.GetHeaderValue(S3Constants.AmzHeaderRequestCharged)); } return(abortMultipartUploadResponse); }
public async Task AbortIncompleteUpload() { string resourceName = nameof(AbortIncompleteUpload); InitiateMultipartUploadResponse initResp = await ObjectClient.InitiateMultipartUploadAsync(BucketName, resourceName).ConfigureAwait(false); Assert.Equal(BucketName, initResp.Bucket); Assert.Equal(resourceName, initResp.Key); Assert.NotNull(initResp.UploadId); AbortMultipartUploadResponse abortResp = await ObjectClient.AbortMultipartUploadAsync(BucketName, resourceName, initResp.UploadId).ConfigureAwait(false); Assert.True(abortResp.IsSuccess); Assert.Equal(204, abortResp.StatusCode); }
private void AbortChunkUpload(string uploadId, string s3Key) { try { AbortMultipartUploadRequest abortRequest = new AbortMultipartUploadRequest { UploadId = uploadId, BucketName = _bucketName, Key = s3Key }; AbortMultipartUploadResponse abortResponse = _awsS3Client.AbortMultipartUpload(abortRequest); } catch (Exception) { } }
public async Task AbortIncompleteUpload(S3Provider _, string bucket, ISimpleClient client) { string objectKey = nameof(AbortIncompleteUpload); CreateMultipartUploadResponse createResp = await client.CreateMultipartUploadAsync(bucket, objectKey).ConfigureAwait(false); Assert.Equal(200, createResp.StatusCode); Assert.Equal(bucket, createResp.BucketName); Assert.Equal(objectKey, createResp.ObjectKey); Assert.NotNull(createResp.UploadId); AbortMultipartUploadResponse abortResp = await client.AbortMultipartUploadAsync(bucket, objectKey, createResp.UploadId).ConfigureAwait(false); Assert.Equal(204, abortResp.StatusCode); }
public async Task AbortIncompleteUpload() { string objectKey = nameof(AbortIncompleteUpload); CreateMultipartUploadResponse createResp = await MultipartClient.CreateMultipartUploadAsync(BucketName, objectKey).ConfigureAwait(false); Assert.Equal(BucketName, createResp.Bucket); Assert.Equal(objectKey, createResp.ObjectKey); Assert.NotNull(createResp.UploadId); AbortMultipartUploadResponse abortResp = await MultipartClient.AbortMultipartUploadAsync(BucketName, objectKey, createResp.UploadId).ConfigureAwait(false); Assert.True(abortResp.IsSuccess); Assert.Equal(204, abortResp.StatusCode); }
static void AbortMultipartUpload() { try { AbortMultipartUploadRequest request = new AbortMultipartUploadRequest() { BucketName = bucketName, ObjectKey = objectName, UploadId = uploadId }; AbortMultipartUploadResponse response = client.AbortMultipartUpload(request); Console.WriteLine("Abort multipart upload response: {0}", response.StatusCode); } catch (ObsException ex) { Console.WriteLine("Exception errorcode: {0}, when abort multipart upload.", ex.ErrorCode); Console.WriteLine("Exception errormessage: {0}", ex.ErrorMessage); } }