Skip to content

Commit c61a9c6

Browse files
anuraagashinfan
authored andcommitted
Remove project id requirement for creating a GCS client. (#2038)
Project id is only required for creating buckets, not operating on them, so it doesn't make sense to make it required for all cases.
1 parent 4cf6e25 commit c61a9c6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

google-cloud-storage/src/main/java/com/google/cloud/storage/StorageOptions.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,13 @@ public static HttpTransportOptions getDefaultHttpTransportOptions() {
105105
return HttpTransportOptions.newBuilder().build();
106106
}
107107

108+
// Project ID is only required for creating buckets, so we don't require it for creating the
109+
// service.
110+
@Override
111+
protected boolean projectIdRequired() {
112+
return false;
113+
}
114+
108115
@Override
109116
protected Set<String> getScopes() {
110117
return SCOPES;

0 commit comments

Comments
 (0)