DELETE on a bucket deletes the bucket if it's not empty.
(a *action)
| 478 | |
| 479 | // DELETE on a bucket deletes the bucket if it's not empty. |
| 480 | func (r bucketResource) delete(a *action) interface{} { |
| 481 | b := r.bucket |
| 482 | if b == nil { |
| 483 | fatalError(404, "NoSuchBucket", "The specified bucket does not exist") |
| 484 | } |
| 485 | if len(b.objects) > 0 { |
| 486 | fatalError(400, "BucketNotEmpty", "The bucket you tried to delete is not empty") |
| 487 | } |
| 488 | delete(a.srv.buckets, b.name) |
| 489 | return nil |
| 490 | } |
| 491 | |
| 492 | // PUT on a bucket creates the bucket. |
| 493 | // http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketPUT.html |
nothing calls this directly
no test coverage detected