Skip to content

Commit 5b92aeb

Browse files
committed
---
yaml --- r: 1037 b: refs/heads/master c: 13572e7 h: refs/heads/master i: 1035: f442819 v: v3
1 parent c886ed2 commit 5b92aeb

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
---
2-
refs/heads/master: 301158716e84080b654dd47e623f35f0ef845087
2+
refs/heads/master: 13572e77e1e0a199d1fa9cc5542e771acfdf027f
33
refs/heads/travis: 0fa997e2fc9c6b61b2d91e6d163655aae67d44b6
44
refs/heads/gh-pages: 5a10432ecc75f29812e33a8236c900379509fe99

trunk/gcloud-java-storage/src/main/java/com/google/gcloud/storage/Blob.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ public Blob(Storage storage, BlobInfo info) {
115115
* @param storage the storage service used for issuing requests
116116
* @param bucket bucket's name
117117
* @param blob blob's name
118+
* @return the {@code Blob} object or {@code null} if not found.
119+
* @throws StorageException upon failure
118120
*/
119121
public static Blob load(Storage storage, String bucket, String blob) {
120122
return load(storage, BlobId.of(bucket, blob));
@@ -126,10 +128,12 @@ public static Blob load(Storage storage, String bucket, String blob) {
126128
*
127129
* @param storage the storage service used for issuing requests
128130
* @param blobId blob's identifier
131+
* @return the {@code Blob} object or {@code null} if not found.
132+
* @throws StorageException upon failure
129133
*/
130134
public static Blob load(Storage storage, BlobId blobId) {
131135
BlobInfo info = storage.get(blobId);
132-
return new Blob(storage, info);
136+
return info != null ? new Blob(storage, info) : null;
133137
}
134138

135139
/**

trunk/gcloud-java-storage/src/main/java/com/google/gcloud/storage/Bucket.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,12 @@ public Bucket(Storage storage, BucketInfo info) {
6161
*
6262
* @param storage the storage service used for issuing requests
6363
* @param bucket bucket's name
64+
* @return the {@code Bucket} object or {@code null} if not found.
65+
* @throws StorageException upon failure
6466
*/
6567
public static Bucket load(Storage storage, String bucket) {
6668
BucketInfo info = storage.get(bucket);
67-
return new Bucket(storage, info);
69+
return info != null ? new Bucket(storage, info) : null;
6870
}
6971

7072
/**

0 commit comments

Comments
 (0)