Package com.dropbox.core.v2.files
Class UploadSessionStartBuilder
java.lang.Object
com.dropbox.core.v2.DbxUploadStyleBuilder<UploadSessionStartResult,UploadSessionStartError,UploadSessionStartErrorException>
com.dropbox.core.v2.files.UploadSessionStartBuilder
public class UploadSessionStartBuilder
extends DbxUploadStyleBuilder<UploadSessionStartResult,UploadSessionStartError,UploadSessionStartErrorException>
The request builder returned by
DbxUserFilesRequests.uploadSessionStartBuilder().
Use this class to set optional request parameters and complete the request.
-
Method Summary
Modifier and TypeMethodDescriptionstart()Begins the upload request using this builder's request parameters and returns aDbxUploaderfor writing the request body.Set value for optional field.withContentHash(String contentHash) Set value for optional field.withSessionType(UploadSessionType sessionType) Set value for optional field.Methods inherited from class com.dropbox.core.v2.DbxUploadStyleBuilder
uploadAndFinish, uploadAndFinish, uploadAndFinish, uploadAndFinish
-
Method Details
-
withClose
Set value for optional field.If left unset or set to
null, defaults tofalse.- Parameters:
close- If true, the current session will be closed, at which point you won't be able to callDbxUserFilesRequests.uploadSessionAppendV2(UploadSessionCursor)anymore with the current session. Defaults tofalsewhen set tonull.- Returns:
- this builder
-
withSessionType
Set value for optional field.- Parameters:
sessionType- Type of upload session you want to start. If not specified, default isUploadSessionType.SEQUENTIAL.- Returns:
- this builder
-
withContentHash
Set value for optional field.- Parameters:
contentHash- A hash of the file content uploaded in this call. If provided and the uploaded content does not match this hash, an error will be returned. For more information see our Content hash page. Must have length of at least 64 and have length of at most 64.- Returns:
- this builder
- Throws:
IllegalArgumentException- If any argument does not meet its preconditions.
-
start
Description copied from class:DbxUploadStyleBuilderBegins the upload request using this builder's request parameters and returns aDbxUploaderfor writing the request body. Callers can complete the request by writing the upload data to theOutputStreamreturned byDbxUploader.getOutputStream()and receiving the server response usingDbxUploader.finish(). SeeDbxUploadStyleBuilder.uploadAndFinish(java.io.InputStream)convenience method for a simpler way to complete the request.- Specified by:
startin classDbxUploadStyleBuilder<UploadSessionStartResult,UploadSessionStartError, UploadSessionStartErrorException> - Returns:
DbxUploaderused to upload data and complete the request- Throws:
DbxException- if an error occursing initializing the requestUploadSessionStartErrorException
-