Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Storage::writer() provides no way to see metadata after writing. #2343

Copy link
Copy link

Description

@BrandonY
Issue body actions

Here's an example of using the Storage::writer method to write a blob from the documentation:

BlobInfo blobInfo = BlobInfo.newBuilder(blobId).setContentType("text/plain").build();
try (WriteChannel writer = storage.writer(blobInfo)) {
   try {
      writer.write(ByteBuffer.wrap(content, 0, content.length));
   } catch (Exception ex) {
     // handle exception
   }
}

This works well and makes it easy to write data to a GCS object with a WriteChannel. However, when the operation finishes, GCS returns the metadata of the new object, most importantly including the generation number of the newly-created object. The writer() method provides no way of accessing this metadata.

We need a way of accessing the metadata of the new object upon success. Perhaps a Blob accessor could be added to the WriteChannel, or some assignable reference could be passed to the writer() method, or some other mechanism.

Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

api: storageIssues related to the Cloud Storage API.Issues related to the Cloud Storage API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.