Package com.google.cloud.storage
Interface BlobAppendableUpload
- All Superinterfaces:
BlobWriteSession
Interface representing those methods which can be used to write to and interact with an
appendable upload.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceTheWritableByteChannelreturned fromopen(). -
Method Summary
Modifier and TypeMethodDescriptioncom.google.api.core.ApiFuture<BlobInfo>Return anApiFuture<BlobInfo>which will represent the state of the object in Google Cloud Storage.open()Open theAppendableUploadWriteableByteChannelfor this session.
-
Method Details
-
open
Open theAppendableUploadWriteableByteChannelfor this session.A session may only be
opened once. If multiple calls to open are made, an illegal state exception will be thrownThe returned
AppendableUploadWriteableByteChannelcan throw IOExceptions from any of its usual methods. AnyIOExceptionthrown can have a cause of aStorageException. However, not allIOExceptionswill haveStorageExceptions.- Specified by:
openin interfaceBlobWriteSession- Throws:
IOException- When creating theBlobAppendableUpload.AppendableUploadWriteableByteChannelif an unrecoverable underlying IOException occurs it can be rethrownIllegalStateException- if open is called more than once- Since:
- 2.51.0 This new api is in preview and is subject to breaking changes.
-
getResult
com.google.api.core.ApiFuture<BlobInfo> getResult()Return anApiFuture<BlobInfo>which will represent the state of the object in Google Cloud Storage.This future will not resolve until:
- The object is successfully finalized in Google Cloud Storage by calling
AppendableUploadWriteableByteChannel#finalizeAndClose() - This session is detached from the upload without finalizing by calling
AppendableUploadWriteableByteChannel#closeWithoutFinalizing() - The session is closed by calling
AppendableUploadWriteableByteChannel#close() - A terminal failure occurs, the terminal failure will become the exception result
NOTICE: Some fields may not be populated unless finalization has completed.
If a terminal failure is encountered, calling either
Future.get()orFuture.get(long, TimeUnit)will result in anExecutionExceptionwith the cause.- Specified by:
getResultin interfaceBlobWriteSession- Since:
- 2.51.0 This new api is in preview and is subject to breaking changes.
- The object is successfully finalized in Google Cloud Storage by calling
-