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 byDbxUserFilesRequests.uploadSessionStartBuilder().Use this class to set optional request parameters and complete the request.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UploadSessionStartUploaderstart()Begins the upload request using this builder's request parameters and returns aDbxUploaderfor writing the request body.UploadSessionStartBuilderwithClose(java.lang.Boolean close)Set value for optional field.UploadSessionStartBuilderwithContentHash(java.lang.String contentHash)Set value for optional field.UploadSessionStartBuilderwithSessionType(UploadSessionType sessionType)Set value for optional field.-
Methods inherited from class com.dropbox.core.v2.DbxUploadStyleBuilder
uploadAndFinish, uploadAndFinish, uploadAndFinish, uploadAndFinish
-
-
-
-
Method Detail
-
withClose
public UploadSessionStartBuilder withClose(java.lang.Boolean close)
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
public UploadSessionStartBuilder withSessionType(UploadSessionType sessionType)
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
public UploadSessionStartBuilder withContentHash(java.lang.String contentHash)
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:
java.lang.IllegalArgumentException- If any argument does not meet its preconditions.
-
start
public UploadSessionStartUploader start() throws UploadSessionStartErrorException, DbxException
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
-
-