Skip to content

Commit 37a2695

Browse files
committed
---
yaml --- r: 4563 b: refs/heads/logging-alpha c: 21e68cc h: refs/heads/master i: 4561: 3cdfff4 4559: 745075b
1 parent d1eccff commit 37a2695

3 files changed

Lines changed: 17 additions & 3 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ refs/heads/compute-alpha: 969cba2627f1d53d352cc4a5ffe0879dacf65e6c
1212
refs/heads/dns-alpha: 2f90e7e338349287ace33375896907af0f032ca1
1313
refs/heads/dns-alpha-batch: 17442b07867021b85d0452f5f3eda29a3413288f
1414
refs/heads/gcs-nio: 283aeaf15efdcf3621eb6859f05e55ad7764375d
15-
refs/heads/logging-alpha: bbe7b500a63bd7bce92e73a13cdb097265b85092
15+
refs/heads/logging-alpha: 21e68cce2c133463fcc4d74e06e3114c5e25ef65
1616
refs/tags/v0.1.0: a615317f7424ed58621b1f65d5c4d8cbbe8a6ed8
1717
refs/tags/v0.1.1: 7a7f6985fe465e9dd6a075af55493f42b4933be0
1818
refs/tags/v0.1.2: 3eb3fe866ba22487686048f45d927b8c8638ea3f

branches/logging-alpha/gcloud-java-storage/src/main/java/com/google/gcloud/storage/Storage.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,16 @@ public static BlobListOption recursive(boolean recursive) {
700700
return new BlobListOption(StorageRpc.Option.DELIMITER, recursive);
701701
}
702702

703+
/**
704+
* If set to {@code true}, lists all versions of a blob.
705+
* The default is {@code false}.
706+
*
707+
* @see <a href ="https://cloud.google.com/storage/docs/object-versioning">Object Versioning</a>
708+
*/
709+
public static BlobListOption versions(boolean versions) {
710+
return new BlobListOption(StorageRpc.Option.VERSIONS, versions);
711+
}
712+
703713
/**
704714
* Returns an option to specify the blob's fields to be returned by the RPC call. If this option
705715
* is not provided all blob's fields are returned. {@code BlobListOption.fields}) can be used to

branches/logging-alpha/gcloud-java-storage/src/test/java/com/google/gcloud/storage/StorageImplTest.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,14 @@ public class StorageImplTest {
200200
Storage.BlobListOption.prefix("prefix");
201201
private static final Storage.BlobListOption BLOB_LIST_FIELDS =
202202
Storage.BlobListOption.fields(Storage.BlobField.CONTENT_TYPE, Storage.BlobField.MD5HASH);
203+
private static final Storage.BlobListOption BLOB_LIST_VERSIONS =
204+
Storage.BlobListOption.versions(false);
203205
private static final Storage.BlobListOption BLOB_LIST_EMPTY_FIELDS =
204206
Storage.BlobListOption.fields();
205207
private static final Map<StorageRpc.Option, ?> BLOB_LIST_OPTIONS = ImmutableMap.of(
206208
StorageRpc.Option.MAX_RESULTS, BLOB_LIST_MAX_RESULT.value(),
207-
StorageRpc.Option.PREFIX, BLOB_LIST_PREFIX.value());
209+
StorageRpc.Option.PREFIX, BLOB_LIST_PREFIX.value(),
210+
StorageRpc.Option.VERSIONS, BLOB_LIST_VERSIONS.value());
208211

209212
private static final String PRIVATE_KEY_STRING = "MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoG"
210213
+ "BAL2xolH1zrISQ8+GzOV29BNjjzq4/HIP8Psd1+cZb81vDklSF+95wB250MSE0BDc81pvIMwj5OmIfLg1NY6uB"
@@ -650,7 +653,8 @@ public void testListBlobsWithOptions() {
650653
EasyMock.replay(storageRpcMock);
651654
initializeService();
652655
ImmutableList<Blob> blobList = ImmutableList.of(expectedBlob1, expectedBlob2);
653-
Page<Blob> page = storage.list(BUCKET_NAME1, BLOB_LIST_MAX_RESULT, BLOB_LIST_PREFIX);
656+
Page<Blob> page =
657+
storage.list(BUCKET_NAME1, BLOB_LIST_MAX_RESULT, BLOB_LIST_PREFIX, BLOB_LIST_VERSIONS);
654658
assertEquals(cursor, page.nextPageCursor());
655659
assertArrayEquals(blobList.toArray(), Iterables.toArray(page.values(), Blob.class));
656660
}

0 commit comments

Comments
 (0)