コード例 #1
0
        public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
        {
            AbortMultipartUploadResponse response = new AbortMultipartUploadResponse();


            return(response);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
ファイル: MultipartTests.cs プロジェクト: LordMike/SimpleS3
        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);
        }
コード例 #4
0
        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) { }
        }
コード例 #5
0
    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);
    }
コード例 #6
0
        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);
        }
コード例 #7
0
        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);
            }
        }