Skip to content
This repository was archived by the owner on Aug 6, 2025. It is now read-only.

Commit 45adfd6

Browse files
committed
JCLOUDS-1646: Use boxed Long in GCS
Previously some objects lacked a content-length so this threw a NullPointerException when unboxing.
1 parent 27d2e20 commit 45adfd6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

providers/google-cloud-storage/src/main/java/org/jclouds/googlecloudstorage/blobstore/GoogleCloudStorageBlobStore.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ public Blob getBlob(String container, String name, GetOptions options) {
251251
MutableBlobMetadata metadata = objectToBlobMetadata.apply(gcsObject);
252252
Blob blob = new BlobImpl(metadata);
253253
Payload payload = api.getObjectApi().download(container, Strings2.urlEncode(name), httpOptions).getPayload();
254-
long contentLength = payload.getContentMetadata().getContentLength();
254+
Long contentLength = payload.getContentMetadata().getContentLength();
255255
payload.setContentMetadata(metadata.getContentMetadata()); // Doing this first retains it on setPayload.
256256
blob.setPayload(payload);
257257
// getObject() returns the full object length but download() could be smaller due to range requests.

0 commit comments

Comments
 (0)