Skip to content

Commit 6f77771

Browse files
authored
---
yaml --- r: 8815 b: refs/heads/lesv-patch-1 c: ca27145 h: refs/heads/master i: 8813: 467e6a0 8811: fc97a4d 8807: 9423665 8799: cd8fd8e
1 parent db3b63f commit 6f77771

6 files changed

Lines changed: 33 additions & 5 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ refs/tags/v0.22.0: 18b298fe4bfe8ec2f20b0e0bf7ffdcce5cc3c5fe
6666
refs/heads/vam-google-patch-1: d0c8fee3a4074d0bf7360ce8c4f7f7223d0ee7b9
6767
refs/heads/vam-google-patch-CODEOWNERS: 2ac1616e25229e51d08a984708ef1918f91a35ee
6868
refs/heads/danoscarmike-patch-1: 7342a9916bce4ed00002c7202e2a16c5d46afaea
69-
refs/heads/lesv-patch-1: 5ddb61a1f6fc1fabaa567d59762a0b73d070a838
69+
refs/heads/lesv-patch-1: ca271453a6d62e302832eef460849812fd7ce4ab
7070
refs/heads/ml-update-branch: 079dd6610017f5c51b9d1938c12d6d55b61513cf
7171
refs/heads/vkedia-patch-2: 7d8241388a9769a5c069334761b06c7012c878e7
7272
refs/heads/vkedia-patch-3: 4d128043acaa7db9160faf439d2ca6104e8a88cb

branches/lesv-patch-1/google-cloud-storage/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<dependency>
3131
<groupId>com.google.apis</groupId>
3232
<artifactId>google-api-services-storage</artifactId>
33-
<version>v1-rev108-1.22.0</version>
33+
<version>v1-rev114-1.23.0</version>
3434
<scope>compile</scope>
3535
<exclusions>
3636
<exclusion>

branches/lesv-patch-1/google-cloud-storage/src/main/java/com/google/cloud/storage/Storage.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,15 @@ public static BucketListOption prefix(String prefix) {
764764
return new BucketListOption(StorageRpc.Option.PREFIX, prefix);
765765
}
766766

767+
/**
768+
* Returns an option for bucket's billing user project. This option is only used by the buckets with
769+
* 'requester_pays' flag.
770+
*/
771+
@GcpLaunchStage.Alpha
772+
public static BucketListOption userProject(String userProject) {
773+
return new BucketListOption(StorageRpc.Option.USER_PROJECT, userProject);
774+
}
775+
767776
/**
768777
* Returns an option to specify the bucket's fields to be returned by the RPC call. If this
769778
* option is not provided all bucket's fields are returned. {@code BucketListOption.fields}) can

branches/lesv-patch-1/google-cloud-storage/src/main/java/com/google/cloud/storage/spi/v1/HttpStorageRpc.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ public Tuple<String, Iterable<Bucket>> list(Map<Option, ?> options) {
252252
.setMaxResults(Option.MAX_RESULTS.getLong(options))
253253
.setPageToken(Option.PAGE_TOKEN.getString(options))
254254
.setFields(Option.FIELDS.getString(options))
255+
.setUserProject(Option.USER_PROJECT.getString(options))
255256
.execute();
256257
return Tuple.<String, Iterable<Bucket>>of(buckets.getNextPageToken(), buckets.getItems());
257258
} catch (IOException ex) {

branches/lesv-patch-1/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITStorageTest.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1519,4 +1519,22 @@ public void testUpdateBucketRequesterPays() {
15191519
assertArrayEquals(BLOB_BYTE_CONTENT, readBytes);
15201520
assertTrue(remoteBlob.delete());
15211521
}
1522+
1523+
@Test
1524+
public void testListBucketRequesterPaysFails() throws InterruptedException {
1525+
String projectId = remoteStorageHelper.getOptions().getProjectId();
1526+
Iterator<Bucket> bucketIterator = storage.list(Storage.BucketListOption.prefix(BUCKET),
1527+
Storage.BucketListOption.fields(), Storage.BucketListOption.userProject(projectId)).iterateAll().iterator();
1528+
while (!bucketIterator.hasNext()) {
1529+
Thread.sleep(500);
1530+
bucketIterator = storage.list(Storage.BucketListOption.prefix(BUCKET),
1531+
Storage.BucketListOption.fields()).iterateAll().iterator();
1532+
}
1533+
while (bucketIterator.hasNext()) {
1534+
Bucket remoteBucket = bucketIterator.next();
1535+
assertTrue(remoteBucket.getName().startsWith(BUCKET));
1536+
assertNull(remoteBucket.getCreateTime());
1537+
assertNull(remoteBucket.getSelfLink());
1538+
}
1539+
}
15221540
}

branches/lesv-patch-1/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@
137137
<github.global.server>github</github.global.server>
138138
<site.installationModule>google-cloud</site.installationModule>
139139

140-
<api-client.version>1.22.0</api-client.version>
140+
<api-client.version>1.23.0</api-client.version>
141141

142142
<api-common.version>1.1.0</api-common.version>
143143
<gax.version>1.9.1</gax.version>
@@ -147,7 +147,7 @@
147147
<grpc.version>1.7.0</grpc.version>
148148
<nettyssl.version>2.0.6.Final</nettyssl.version>
149149
<guava.version>20.0</guava.version>
150-
<http-client.version>1.22.0</http-client.version>
150+
<http-client.version>1.23.0</http-client.version>
151151
<protobuf.version>3.4.0</protobuf.version>
152152

153153
<easymock.version>3.4</easymock.version>
@@ -767,7 +767,7 @@
767767
<dependency>
768768
<groupId>com.google.oauth-client</groupId>
769769
<artifactId>google-oauth-client</artifactId>
770-
<version>1.22.0</version>
770+
<version>1.23.0</version>
771771
</dependency>
772772
<dependency>
773773
<groupId>com.google.api-client</groupId>

0 commit comments

Comments
 (0)