public class UploadBuilder extends DbxUploadStyleBuilder<FileMetadata,UploadError,UploadErrorException>
DbxUserFilesRequests.uploadBuilder(java.lang.String)
.
Use this class to set optional request parameters and complete the request.
Modifier and Type | Method and Description |
---|---|
UploadUploader |
start()
Begins the upload request using this builder's request parameters and returns a
DbxUploader for writing the request body. |
UploadBuilder |
withAutorename(java.lang.Boolean autorename)
Set value for optional field.
|
UploadBuilder |
withClientModified(java.util.Date clientModified)
Set value for optional field.
|
UploadBuilder |
withMode(WriteMode mode)
Set value for optional field.
|
UploadBuilder |
withMute(java.lang.Boolean mute)
Set value for optional field.
|
UploadBuilder |
withPropertyGroups(java.util.List<PropertyGroup> propertyGroups)
Set value for optional field.
|
UploadBuilder |
withStrictConflict(java.lang.Boolean strictConflict)
Set value for optional field.
|
uploadAndFinish, uploadAndFinish, uploadAndFinish, uploadAndFinish
public UploadBuilder withMode(WriteMode mode)
If left unset or set to null
, defaults to WriteMode.ADD
.
mode
- Selects what to do if the file already exists. Must not be
null
. Defaults to WriteMode.ADD
when set to null
.java.lang.IllegalArgumentException
- If any argument does not meet its
preconditions.public UploadBuilder withAutorename(java.lang.Boolean autorename)
If left unset or set to null
, defaults to false
.
autorename
- If there's a conflict, as determined by CommitInfo.getMode()
, have the Dropbox server try to autorename the
file to avoid conflict. Defaults to false
when set to null
.public UploadBuilder withClientModified(java.util.Date clientModified)
clientModified
- The value to store as the CommitInfo.getClientModified()
timestamp. Dropbox automatically
records the time at which the file was written to the Dropbox
servers. It can also record an additional timestamp, provided by
Dropbox desktop clients, mobile clients, and API apps of when the
file was actually created or modified.public UploadBuilder withMute(java.lang.Boolean mute)
If left unset or set to null
, defaults to false
.
mute
- Normally, users are made aware of any file modifications in
their Dropbox account via notifications in the client software. If
true
, this tells the clients that this modification shouldn't
result in a user notification. Defaults to false
when set to
null
.public UploadBuilder withPropertyGroups(java.util.List<PropertyGroup> propertyGroups)
propertyGroups
- List of custom properties to add to file. Must not
contain a null
item.java.lang.IllegalArgumentException
- If any argument does not meet its
preconditions.public UploadBuilder withStrictConflict(java.lang.Boolean strictConflict)
If left unset or set to null
, defaults to false
.
strictConflict
- Be more strict about how each WriteMode
detects conflict. For example, always return a conflict error when
CommitInfo.getMode()
= WriteMode.getUpdateValue()
and the
given "rev" doesn't match the existing file's "rev", even if the
existing file has been deleted. Defaults to false
when set to
null
.public UploadUploader start() throws UploadErrorException, DbxException
DbxUploadStyleBuilder
DbxUploader
for writing the request body.
Callers can complete the request by writing the upload data to the OutputStream
returned by DbxUploader.getOutputStream()
and receiving the server response using
DbxUploader.finish()
.
See DbxUploadStyleBuilder.uploadAndFinish(java.io.InputStream)
convenience method for a simpler way to complete the request.start
in class DbxUploadStyleBuilder<FileMetadata,UploadError,UploadErrorException>
DbxUploader
used to upload data and complete the requestDbxException
- if an error occursing initializing the requestUploadErrorException