| 1525 | } |
| 1526 | |
| 1527 | Status GcsFileSystem::DeleteFile(const string& fname) { |
| 1528 | string bucket, object; |
| 1529 | TF_RETURN_IF_ERROR(ParseGcsPath(fname, false, &bucket, &object)); |
| 1530 | |
| 1531 | std::unique_ptr<HttpRequest> request; |
| 1532 | TF_RETURN_IF_ERROR(CreateHttpRequest(&request)); |
| 1533 | request->SetUri(strings::StrCat(kGcsUriBase, "b/", bucket, "/o/", |
| 1534 | request->EscapeString(object))); |
| 1535 | request->SetTimeouts(timeouts_.connect, timeouts_.idle, timeouts_.metadata); |
| 1536 | request->SetDeleteRequest(); |
| 1537 | |
| 1538 | TF_RETURN_WITH_CONTEXT_IF_ERROR(request->Send(), " when deleting ", fname); |
| 1539 | ClearFileCaches(fname); |
| 1540 | return Status::OK(); |
| 1541 | } |
| 1542 | |
| 1543 | Status GcsFileSystem::CreateDir(const string& dirname) { |
| 1544 | string bucket, object; |