Пример #1
0
        private Response GetBucket(string bucket, string method)
        {
            if (method.ToUpperInvariant() == "HEAD")
            {
                return(CheckBucketExist(bucket));
            }

            if (Request.Url.Query == "?acl")
            {
                var response = responder.Respond(new ACLRequest());
                return(response);
            }

            return(ListObjects(bucket));
        }
Пример #2
0
        private Response ListBuckets()
        {
            var bucketList = storage.GetBuckets();

            var response = responder.Respond(bucketList);

            return(response);
        }
Пример #3
0
        private Response CheckDelete(string bucket)
        {
            if (Request.Url.Query == "?delete")
            {
                var serializer    = new XmlSerializer(typeof(DeleteRequest));
                var deleteRequest = (DeleteRequest)serializer.Deserialize(Request.Body);
                storage.DeleteObject(bucket, deleteRequest.Object.Key);
                return(responder.Respond(deleteRequest));
            }

            var response = new Response {
                StatusCode = HttpStatusCode.NoContent
            };

            return(response);
        }