Skip to content

Commit 1623b60

Browse files
author
Frank Natividad
committed
---
yaml --- r: 8429 b: refs/heads/master c: 454eaa2 h: refs/heads/master i: 8427: 9033de8
1 parent 82e5553 commit 1623b60

2 files changed

Lines changed: 3 additions & 8 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: e46b57cd83f81806d0bfe2ce8993291057f089ff
2+
refs/heads/master: 454eaa278c10681f9950ca29d9c857b278ad0e01
33
refs/heads/travis: 47e4fee4fd5af9b2a8ce46f23c72ec95f9b195b2
44
refs/heads/gh-pages: 3e16a39145437096333db5811e5c0292719c1823
55
refs/tags/0.0.9: 22f1839238f66c39e67ed4dfdcd273b1ae2e8444

trunk/google-cloud-examples/src/main/java/com/google/cloud/examples/storage/snippets/StorageSnippets.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,8 +1114,6 @@ public Bucket getRequesterPaysStatus(String bucketName) throws StorageException
11141114
public void downloadFileUsingRequesterPays(String projectId, String bucketName,
11151115
String srcFilename, Path destFilePath) throws IOException {
11161116
// [START storage_download_file_requester_pays]
1117-
// Instantiate a Google Cloud Storage client
1118-
11191117
// The project ID to bill
11201118
// String projectId = "my-billable-project-id";
11211119

@@ -1131,14 +1129,11 @@ public void downloadFileUsingRequesterPays(String projectId, String bucketName,
11311129
// Instantiate a Google Cloud Storage client
11321130
Storage storage = StorageOptions.getDefaultInstance().getService();
11331131

1134-
// Set billing project
1135-
BlobSourceOption option = BlobSourceOption.userProject(projectId);
1136-
11371132
// Get specific file from specified bucket
1138-
Blob blob = BlobId.of(bucketName, srcFilename);
1133+
Blob blob = storage.get(BlobId.of(bucketName, srcFilename));
11391134

11401135
// Download file to specified path
1141-
blob.downloatTo(destFilePath, option);
1136+
blob.downloadTo(destFilePath, Blob.BlobSourceOption.userProject(projectId));
11421137
// [END storage_download_file_requester_pays]
11431138
}
11441139
}

0 commit comments

Comments
 (0)