Send feedback
Interface BlobWriteSession (2.39.0)
Stay organized with collections
Save and categorize content based on your preferences.
Version 2.39.0 keyboard_arrow_down
Beta
This library is covered by the Pre-GA Offerings Terms
of the Terms of Service. Pre-GA libraries might have limited support,
and changes to pre-GA libraries might not be compatible with other pre-GA versions.
For more information, see the
launch stage descriptions .
public interface BlobWriteSession
A session to write an object to Google Cloud Storage.
A session can only write a single version of an object. If writing multiple versions of an
object a new session must be created each time.
Provides an api that allows writing to and retrieving the resulting BlobInfo after
write finalization.
The underlying implementation is dictated based upon the specified BlobWriteSessionConfig provided at StorageOptions creation time.
See Also: BlobWriteSessionConfigs , GrpcStorageOptions.Builder#setBlobWriteSessionConfig(BlobWriteSessionConfig) , BlobWriteSessionConfig
Methods
getResult()
public abstract ApiFuture<BlobInfo> getResult ()
Beta
This feature is covered by the Pre-GA Offerings Terms of the Terms of Service. Pre-GA libraries might have limited support, and changes to pre-GA libraries might not be compatible with other pre-GA versions. For more information, see the launch stage descriptions.
Return an ApiFuture <BlobInfo>
which will represent the state of the object upon
finalization and success response from Google Cloud Storage.
This future will not resolve until: 1. The object is successfully finalized and created in
Google Cloud Storage 2. A terminal failure occurs, the terminal failure will become the
exception result
If a terminal failure is encountered, calling either ApiFuture#get() or ApiFuture#get(long, TimeUnit) will result in an java.util.concurrent.ExecutionException with a cause that is the StorageException .
open()
public abstract WritableByteChannel open ()
Beta
This feature is covered by the Pre-GA Offerings Terms of the Terms of Service. Pre-GA libraries might have limited support, and changes to pre-GA libraries might not be compatible with other pre-GA versions. For more information, see the launch stage descriptions.
Open the WritableByteChannel for this session.
A session may only be open
ed once. If multiple calls to open are made, an illegal
state exception will be thrown
Upon calling WritableByteChannel#close() the object creation will be finalized, and
#getResult() s future should resolve.
The returned WritableByteChannel
can throw IOExceptions from any of its usual
methods. Any IOException thrown can have a cause of a StorageException .
However, not all IOExceptions
will have StorageException
s.
Exceptions
Type
Description
IOException
When creating the WritableByteChannel if an unrecoverable
underlying IOException occurs it can be rethrown
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-24 UTC.
[{
"type": "thumb-down",
"id": "hardToUnderstand",
"label":"Hard to understand"
},{
"type": "thumb-down",
"id": "incorrectInformationOrSampleCode",
"label":"Incorrect information or sample code"
},{
"type": "thumb-down",
"id": "missingTheInformationSamplesINeed",
"label":"Missing the information/samples I need"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
Need to tell us more?
{"lastModified": "Last updated 2024-09-24 UTC."}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-24 UTC."]]