File tree Expand file tree Collapse file tree
main/java/com/google/gcloud/storage
test/java/com/google/gcloud/storage Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -150,11 +150,12 @@ public BlobId id() {
150150 /**
151151 * Checks if this blob exists.
152152 *
153+ * @param options blob read options
153154 * @return true if this blob exists, false otherwise
154155 * @throws StorageException upon failure
155156 */
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;
158159 }
159160
160161 /**
Original file line number Diff line number Diff line change @@ -70,14 +70,14 @@ public void testInfo() throws Exception {
7070
7171 @Test
7272 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);
7474 replay(storage);
7575 assertTrue(blob.exists());
7676 }
7777
7878 @Test
7979 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);
8181 replay(storage);
8282 assertFalse(blob.exists());
8383 }
You can’t perform that action at this time.
0 commit comments