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)); }
private Response ListBuckets() { var bucketList = storage.GetBuckets(); var response = responder.Respond(bucketList); return(response); }
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); }