Package com.dropbox.core.v2.files
Class CommitInfo.Builder
- java.lang.Object
-
- com.dropbox.core.v2.files.CommitInfo.Builder
-
- Enclosing class:
- CommitInfo
public static class CommitInfo.Builder extends java.lang.Object
Builder forCommitInfo
.
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
autorename
protected java.util.Date
clientModified
protected WriteMode
mode
protected boolean
mute
protected java.lang.String
path
protected java.util.List<PropertyGroup>
propertyGroups
protected boolean
strictConflict
-
Constructor Summary
Constructors Modifier Constructor Description protected
Builder(java.lang.String path)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CommitInfo
build()
Builds an instance ofCommitInfo
configured with this builder's valuesCommitInfo.Builder
withAutorename(java.lang.Boolean autorename)
Set value for optional field.CommitInfo.Builder
withClientModified(java.util.Date clientModified)
Set value for optional field.CommitInfo.Builder
withMode(WriteMode mode)
Set value for optional field.CommitInfo.Builder
withMute(java.lang.Boolean mute)
Set value for optional field.CommitInfo.Builder
withPropertyGroups(java.util.List<PropertyGroup> propertyGroups)
Set value for optional field.CommitInfo.Builder
withStrictConflict(java.lang.Boolean strictConflict)
Set value for optional field.
-
-
-
Field Detail
-
path
protected final java.lang.String path
-
mode
protected WriteMode mode
-
autorename
protected boolean autorename
-
clientModified
protected java.util.Date clientModified
-
mute
protected boolean mute
-
propertyGroups
protected java.util.List<PropertyGroup> propertyGroups
-
strictConflict
protected boolean strictConflict
-
-
Method Detail
-
withMode
public CommitInfo.Builder withMode(WriteMode mode)
Set value for optional field.If left unset or set to
null
, defaults toWriteMode.ADD
.- Parameters:
mode
- Selects what to do if the file already exists. Must not benull
. Defaults toWriteMode.ADD
when set tonull
.- Returns:
- this builder
- Throws:
java.lang.IllegalArgumentException
- If any argument does not meet its preconditions.
-
withAutorename
public CommitInfo.Builder withAutorename(java.lang.Boolean autorename)
Set value for optional field.If left unset or set to
null
, defaults tofalse
.- Parameters:
autorename
- If there's a conflict, as determined byCommitInfo.getMode()
, have the Dropbox server try to autorename the file to avoid conflict. Defaults tofalse
when set tonull
.- Returns:
- this builder
-
withClientModified
public CommitInfo.Builder withClientModified(java.util.Date clientModified)
Set value for optional field.- Parameters:
clientModified
- The value to store as theCommitInfo.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.- Returns:
- this builder
-
withMute
public CommitInfo.Builder withMute(java.lang.Boolean mute)
Set value for optional field.If left unset or set to
null
, defaults tofalse
.- Parameters:
mute
- Normally, users are made aware of any file modifications in their Dropbox account via notifications in the client software. Iftrue
, this tells the clients that this modification shouldn't result in a user notification. Defaults tofalse
when set tonull
.- Returns:
- this builder
-
withPropertyGroups
public CommitInfo.Builder withPropertyGroups(java.util.List<PropertyGroup> propertyGroups)
Set value for optional field.- Parameters:
propertyGroups
- List of custom properties to add to file. Must not contain anull
item.- Returns:
- this builder
- Throws:
java.lang.IllegalArgumentException
- If any argument does not meet its preconditions.
-
withStrictConflict
public CommitInfo.Builder withStrictConflict(java.lang.Boolean strictConflict)
Set value for optional field.If left unset or set to
null
, defaults tofalse
.- Parameters:
strictConflict
- Be more strict about how eachWriteMode
detects conflict. For example, always return a conflict error whenCommitInfo.getMode()
=WriteMode.getUpdateValue()
and the given "rev" doesn't match the existing file's "rev", even if the existing file has been deleted. This also forces a conflict even when the target path refers to a file with identical contents. Defaults tofalse
when set tonull
.- Returns:
- this builder
-
build
public CommitInfo build()
Builds an instance ofCommitInfo
configured with this builder's values- Returns:
- new instance of
CommitInfo
-
-