(uri *url.URL)
| 159 | } |
| 160 | |
| 161 | func (mc *MinioClient) ValidateBucket(uri *url.URL) (string, string, error) { |
| 162 | bucketName, objectPrefix := mc.ParseBucketAndPrefix(uri.Path) |
| 163 | |
| 164 | // verify the requested bucket exists. |
| 165 | found, err := mc.BucketExists(context.Background(), bucketName) |
| 166 | if err != nil { |
| 167 | return "", "", errors.Wrapf(err, "while looking for bucket %s at host %s", bucketName, uri.Host) |
| 168 | } |
| 169 | if !found { |
| 170 | return "", "", errors.Errorf("Bucket was not found: %s", bucketName) |
| 171 | } |
| 172 | |
| 173 | return bucketName, objectPrefix, nil |
| 174 | } |
no test coverage detected