Skip to content

Commit 9bff1da

Browse files
committed
Merge branch 'directpath-bound-token' of github.com:rockspore/java-storage into directpath-bound-token
2 parents 739f304 + 553367a commit 9bff1da

File tree

19 files changed

+95
-59
lines changed

19 files changed

+95
-59
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Changelog
22

3+
## [2.48.2](https://github.com/googleapis/java-storage/compare/v2.48.1...v2.48.2) (2025-02-11)
4+
5+
6+
### Dependencies
7+
8+
* Update sdk-platform-java dependencies ([#2921](https://github.com/googleapis/java-storage/issues/2921)) ([fa9b0a8](https://github.com/googleapis/java-storage/commit/fa9b0a8d6e2b185c0588d824329b409718bef302))
9+
10+
11+
### Documentation
12+
13+
* Update storage_copy_file to include MegabytesCopiedPerChunk ([#2910](https://github.com/googleapis/java-storage/issues/2910)) ([971ca5d](https://github.com/googleapis/java-storage/commit/971ca5d107967960e6db6ca76a55e44b9aefc605))
14+
315
## [2.48.1](https://github.com/googleapis/java-storage/compare/v2.48.0...v2.48.1) (2025-02-03)
416

517

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ implementation 'com.google.cloud:google-cloud-storage'
6666
If you are using Gradle without BOM, add this to your dependencies:
6767

6868
```Groovy
69-
implementation 'com.google.cloud:google-cloud-storage:2.48.1'
69+
implementation 'com.google.cloud:google-cloud-storage:2.48.2'
7070
```
7171

7272
If you are using SBT, add this to your dependencies:
7373

7474
```Scala
75-
libraryDependencies += "com.google.cloud" % "google-cloud-storage" % "2.48.1"
75+
libraryDependencies += "com.google.cloud" % "google-cloud-storage" % "2.48.2"
7676
```
7777

7878
## Authentication
@@ -515,7 +515,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
515515
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-storage/java11.html
516516
[stability-image]: https://img.shields.io/badge/stability-stable-green
517517
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-storage.svg
518-
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-storage/2.48.1
518+
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-storage/2.48.2
519519
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
520520
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
521521
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles

gapic-google-cloud-storage-v2/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
<modelVersion>4.0.0</modelVersion>
55
<groupId>com.google.api.grpc</groupId>
66
<artifactId>gapic-google-cloud-storage-v2</artifactId>
7-
<version>2.48.2-SNAPSHOT</version><!-- {x-version-update:gapic-google-cloud-storage-v2:current} -->
7+
<version>2.48.3-SNAPSHOT</version><!-- {x-version-update:gapic-google-cloud-storage-v2:current} -->
88
<name>gapic-google-cloud-storage-v2</name>
99
<description>GRPC library for gapic-google-cloud-storage-v2</description>
1010
<parent>
1111
<groupId>com.google.cloud</groupId>
1212
<artifactId>google-cloud-storage-parent</artifactId>
13-
<version>2.48.2-SNAPSHOT</version><!-- {x-version-update:google-cloud-storage:current} -->
13+
<version>2.48.3-SNAPSHOT</version><!-- {x-version-update:google-cloud-storage:current} -->
1414
</parent>
1515
<dependencies>
1616
<dependency>

google-cloud-storage-bom/pom.xml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<modelVersion>4.0.0</modelVersion>
2020
<groupId>com.google.cloud</groupId>
2121
<artifactId>google-cloud-storage-bom</artifactId>
22-
<version>2.48.2-SNAPSHOT</version><!-- {x-version-update:google-cloud-storage:current} -->
22+
<version>2.48.3-SNAPSHOT</version><!-- {x-version-update:google-cloud-storage:current} -->
2323
<packaging>pom</packaging>
2424
<parent>
2525
<groupId>com.google.cloud</groupId>
@@ -69,37 +69,37 @@
6969
<dependency>
7070
<groupId>com.google.cloud</groupId>
7171
<artifactId>google-cloud-storage</artifactId>
72-
<version>2.48.2-SNAPSHOT</version><!-- {x-version-update:google-cloud-storage:current} -->
72+
<version>2.48.3-SNAPSHOT</version><!-- {x-version-update:google-cloud-storage:current} -->
7373
</dependency>
7474
<dependency>
7575
<groupId>com.google.api.grpc</groupId>
7676
<artifactId>gapic-google-cloud-storage-v2</artifactId>
77-
<version>2.48.2-SNAPSHOT</version><!-- {x-version-update:gapic-google-cloud-storage-v2:current} -->
77+
<version>2.48.3-SNAPSHOT</version><!-- {x-version-update:gapic-google-cloud-storage-v2:current} -->
7878
</dependency>
7979
<dependency>
8080
<groupId>com.google.api.grpc</groupId>
8181
<artifactId>grpc-google-cloud-storage-v2</artifactId>
82-
<version>2.48.2-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-storage-v2:current} -->
82+
<version>2.48.3-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-storage-v2:current} -->
8383
</dependency>
8484
<dependency>
8585
<groupId>com.google.api.grpc</groupId>
8686
<artifactId>proto-google-cloud-storage-v2</artifactId>
87-
<version>2.48.2-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-storage-v2:current} -->
87+
<version>2.48.3-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-storage-v2:current} -->
8888
</dependency>
8989
<dependency>
9090
<groupId>com.google.cloud</groupId>
9191
<artifactId>google-cloud-storage-control</artifactId>
92-
<version>2.48.2-SNAPSHOT</version><!-- {x-version-update:google-cloud-storage-control:current} -->
92+
<version>2.48.3-SNAPSHOT</version><!-- {x-version-update:google-cloud-storage-control:current} -->
9393
</dependency>
9494
<dependency>
9595
<groupId>com.google.api.grpc</groupId>
9696
<artifactId>grpc-google-cloud-storage-control-v2</artifactId>
97-
<version>2.48.2-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-storage-control-v2:current} -->
97+
<version>2.48.3-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-storage-control-v2:current} -->
9898
</dependency>
9999
<dependency>
100100
<groupId>com.google.api.grpc</groupId>
101101
<artifactId>proto-google-cloud-storage-control-v2</artifactId>
102-
<version>2.48.2-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-storage-control-v2:current} -->
102+
<version>2.48.3-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-storage-control-v2:current} -->
103103
</dependency>
104104
</dependencies>
105105
</dependencyManagement>

google-cloud-storage-control/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
<modelVersion>4.0.0</modelVersion>
66
<groupId>com.google.cloud</groupId>
77
<artifactId>google-cloud-storage-control</artifactId>
8-
<version>2.48.2-SNAPSHOT</version><!-- {x-version-update:google-cloud-storage-control:current} -->
8+
<version>2.48.3-SNAPSHOT</version><!-- {x-version-update:google-cloud-storage-control:current} -->
99
<name>google-cloud-storage-control</name>
1010
<description>GRPC library for google-cloud-storage-control</description>
1111
<parent>
1212
<groupId>com.google.cloud</groupId>
1313
<artifactId>google-cloud-storage-parent</artifactId>
14-
<version>2.48.2-SNAPSHOT</version><!-- {x-version-update:google-cloud-storage:current} -->
14+
<version>2.48.3-SNAPSHOT</version><!-- {x-version-update:google-cloud-storage:current} -->
1515
</parent>
1616

1717
<dependencies>

google-cloud-storage/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
33
<modelVersion>4.0.0</modelVersion>
44
<artifactId>google-cloud-storage</artifactId>
5-
<version>2.48.2-SNAPSHOT</version><!-- {x-version-update:google-cloud-storage:current} -->
5+
<version>2.48.3-SNAPSHOT</version><!-- {x-version-update:google-cloud-storage:current} -->
66
<packaging>jar</packaging>
77
<name>Google Cloud Storage</name>
88
<url>https://github.com/googleapis/java-storage</url>
@@ -12,11 +12,11 @@
1212
<parent>
1313
<groupId>com.google.cloud</groupId>
1414
<artifactId>google-cloud-storage-parent</artifactId>
15-
<version>2.48.2-SNAPSHOT</version><!-- {x-version-update:google-cloud-storage:current} -->
15+
<version>2.48.3-SNAPSHOT</version><!-- {x-version-update:google-cloud-storage:current} -->
1616
</parent>
1717
<properties>
1818
<site.installationModule>google-cloud-storage</site.installationModule>
19-
<pubsub-proto.version>1.118.1</pubsub-proto.version>
19+
<pubsub-proto.version>1.119.0</pubsub-proto.version>
2020
</properties>
2121
<dependencies>
2222
<dependency>

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
import com.google.cloud.storage.UnifiedOpts.ProjectId;
7070
import com.google.cloud.storage.UnifiedOpts.UserProject;
7171
import com.google.common.annotations.VisibleForTesting;
72+
import com.google.common.base.Suppliers;
7273
import com.google.common.collect.ImmutableList;
7374
import com.google.common.collect.ImmutableSet;
7475
import com.google.common.collect.Streams;
@@ -130,6 +131,7 @@
130131
import java.util.concurrent.TimeUnit;
131132
import java.util.function.Consumer;
132133
import java.util.function.Predicate;
134+
import java.util.function.Supplier;
133135
import java.util.function.UnaryOperator;
134136
import java.util.stream.Stream;
135137
import java.util.stream.StreamSupport;
@@ -167,7 +169,7 @@ final class GrpcStorageImpl extends BaseService<StorageOptions>
167169

168170
// workaround for https://github.com/googleapis/java-storage/issues/1736
169171
private final Opts<UserProject> defaultOpts;
170-
@Deprecated private final ProjectId defaultProjectId;
172+
@Deprecated private final Supplier<ProjectId> defaultProjectId;
171173

172174
GrpcStorageImpl(
173175
GrpcStorageOptions options,
@@ -183,7 +185,7 @@ final class GrpcStorageImpl extends BaseService<StorageOptions>
183185
this.codecs = Conversions.grpc();
184186
this.retryAlgorithmManager = options.getRetryAlgorithmManager();
185187
this.syntaxDecoders = new SyntaxDecoders();
186-
this.defaultProjectId = UnifiedOpts.projectId(options.getProjectId());
188+
this.defaultProjectId = Suppliers.memoize(() -> UnifiedOpts.projectId(options.getProjectId()));
187189
}
188190

189191
@Override
@@ -443,6 +445,7 @@ public Page<Bucket> list(BucketListOption... options) {
443445
opts.grpcMetadataMapper().apply(GrpcCallContext.createDefault());
444446
ListBucketsRequest request =
445447
defaultProjectId
448+
.get()
446449
.listBuckets()
447450
.andThen(opts.listBucketsRequest())
448451
.apply(ListBucketsRequest.newBuilder())

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5036,6 +5036,8 @@ default BlobWriteSession blobWriteSession(BlobInfo blobInfo, BlobWriteOption...
50365036
* {@link Storage#delete(BlobId)}, however without the ability to change metadata fields for the
50375037
* target object.
50385038
*
5039+
* <p>This feature is currently only supported for HNS (Hierarchical Namespace) buckets.
5040+
*
50395041
* @since 2.48.0
50405042
*/
50415043
@TransportCompatibility({Transport.HTTP, Transport.GRPC})

google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITStorageOptionsTest.java

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
import com.google.cloud.storage.it.runner.annotations.Parameterized.ParametersProvider;
3434
import com.google.cloud.storage.it.runner.annotations.SingleBackend;
3535
import com.google.common.collect.ImmutableList;
36-
import org.junit.Ignore;
3736
import org.junit.Test;
3837
import org.junit.runner.RunWith;
3938

@@ -73,12 +72,32 @@ public void clientShouldConstructCleanly_grpc() throws Exception {
7372
}
7473

7574
@Test
76-
@Ignore("waiting on conformation from the backend team if this should even be possible")
7775
public void clientShouldConstructCleanly_directPath() throws Exception {
7876
assumeTrue(
7977
"Unable to determine environment can access directPath", TestUtils.isOnComputeEngine());
8078
StorageOptions options =
81-
StorageOptions.grpc().setCredentials(credentials).setAttemptDirectPath(true).build();
79+
StorageOptions.grpc()
80+
.setCredentials(credentials)
81+
.setAttemptDirectPath(true)
82+
.setEnableGrpcClientMetrics(false)
83+
.build();
84+
doTest(options);
85+
}
86+
87+
@Test
88+
public void lackOfProjectIdDoesNotPreventConstruction_http() throws Exception {
89+
StorageOptions options = StorageOptions.http().setCredentials(credentials).build();
90+
doTest(options);
91+
}
92+
93+
@Test
94+
public void lackOfProjectIdDoesNotPreventConstruction_grpc() throws Exception {
95+
StorageOptions options =
96+
StorageOptions.grpc()
97+
.setCredentials(credentials)
98+
.setAttemptDirectPath(false)
99+
.setEnableGrpcClientMetrics(false)
100+
.build();
82101
doTest(options);
83102
}
84103

grpc-google-cloud-storage-control-v2/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
<modelVersion>4.0.0</modelVersion>
55
<groupId>com.google.api.grpc</groupId>
66
<artifactId>grpc-google-cloud-storage-control-v2</artifactId>
7-
<version>2.48.2-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-storage-control-v2:current} -->
7+
<version>2.48.3-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-storage-control-v2:current} -->
88
<name>grpc-google-cloud-storage-control-v2</name>
99
<description>GRPC library for google-cloud-storage</description>
1010
<parent>
1111
<groupId>com.google.cloud</groupId>
1212
<artifactId>google-cloud-storage-parent</artifactId>
13-
<version>2.48.2-SNAPSHOT</version><!-- {x-version-update:google-cloud-storage:current} -->
13+
<version>2.48.3-SNAPSHOT</version><!-- {x-version-update:google-cloud-storage:current} -->
1414
</parent>
1515
<dependencies>
1616
<dependency>

0 commit comments

Comments
 (0)