File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
main/java/com/google/gcloud/storage
test/java/com/google/gcloud/storage Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -150,11 +150,12 @@ public BlobId id() {
150
150
/**
151
151
* Checks if this blob exists.
152
152
*
153
+ * @param options blob read options
153
154
* @return true if this blob exists, false otherwise
154
155
* @throws StorageException upon failure
155
156
*/
156
- public boolean exists () {
157
- return storage .get (info .blobId ()) != null ;
157
+ public boolean exists (BlobSourceOption ... options ) {
158
+ return storage .get (info .blobId (), convert ( info , options ) ) != null ;
158
159
}
159
160
160
161
/**
Original file line number Diff line number Diff line change @@ -70,14 +70,14 @@ public void testInfo() throws Exception {
70
70
71
71
@ Test
72
72
public void testExists_True () throws Exception {
73
- expect (storage .get (BLOB_INFO .blobId ())).andReturn (BLOB_INFO );
73
+ expect (storage .get (BLOB_INFO .blobId (), new Storage . BlobSourceOption [ 0 ] )).andReturn (BLOB_INFO );
74
74
replay (storage );
75
75
assertTrue (blob .exists ());
76
76
}
77
77
78
78
@ Test
79
79
public void testExists_False () throws Exception {
80
- expect (storage .get (BLOB_INFO .blobId ())).andReturn (null );
80
+ expect (storage .get (BLOB_INFO .blobId (), new Storage . BlobSourceOption [ 0 ] )).andReturn (null );
81
81
replay (storage );
82
82
assertFalse (blob .exists ());
83
83
}
You can’t perform that action at this time.
0 commit comments