Class ResumableUploadOptions.Builder (2.87.0)

public abstract static class ResumableUploadOptions.Builder

Inheritance

java.lang.Object > ResumableUploadOptions.Builder

Constructors

Builder()

public Builder()

Methods

build()

public ResumableUploadOptions build()
Returns
Type Description
ResumableUploadOptions

getChunkSize()

public abstract int getChunkSize()

Returns the chunk size in bytes. See #setChunkSize(int).

Returns
Type Description
int

getGlobalTimeout()

public abstract @Nullable Duration getGlobalTimeout()

Returns the global upload timeout, or null if unset. See #setGlobalTimeout(Duration).

Returns
Type Description
@org.jspecify.annotations.Nullable java.time.Duration

setChunkSize(int chunkSize)

public abstract ResumableUploadOptions.Builder setChunkSize(int chunkSize)

Sets the chunk size in bytes. The payload is sent in chunks of this size, and each chunk is buffered in memory so it can be resent if the upload needs to recover. Must be positive; defaults to 8 MB.

Parameter
Name Description
chunkSize int
Returns
Type Description
ResumableUploadOptions.Builder

setGlobalTimeout(@Nullable Duration globalTimeout)

public abstract ResumableUploadOptions.Builder setGlobalTimeout(@Nullable Duration globalTimeout)

Sets the global timeout bounding the entire upload, including session initiation, chunk transmission, and recovery. If the upload has not completed when the timeout elapses, it is cancelled and fails. Must be positive.

Parameter
Name Description
globalTimeout @org.jspecify.annotations.Nullable java.time.Duration
Returns
Type Description
ResumableUploadOptions.Builder

setProgressListener(@Nullable ResumableUploadProgressListener progressListener)

public abstract ResumableUploadOptions.Builder setProgressListener(@Nullable ResumableUploadProgressListener progressListener)

Sets the listener notified of upload progress and state transitions. Updates are delivered in order, beginning with ResumableUploadProgress#STATE_STARTING. Callbacks are dispatched on the client's background executor.

Parameter
Name Description
progressListener @org.jspecify.annotations.Nullable com.google.api.gax.rpc.ResumableUploadProgressListener
Returns
Type Description
ResumableUploadOptions.Builder