Package com.dropbox.core.v2.files
Class CommitInfo
- java.lang.Object
-
- com.dropbox.core.v2.files.CommitInfo
-
public class CommitInfo extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CommitInfo.Builder
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 Constructor Description CommitInfo(java.lang.String path)
NoneCommitInfo(java.lang.String path, WriteMode mode, boolean autorename, java.util.Date clientModified, boolean mute, java.util.List<PropertyGroup> propertyGroups, boolean strictConflict)
UsenewBuilder(java.lang.String)
to create instances of this class without specifying values for all optional fields.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
boolean
getAutorename()
If there's a conflict, as determined bygetMode()
, have the Dropbox server try to autorename the file to avoid conflict.java.util.Date
getClientModified()
The value to store as thegetClientModified()
timestamp.WriteMode
getMode()
Selects what to do if the file already exists.boolean
getMute()
Normally, users are made aware of any file modifications in their Dropbox account via notifications in the client software.java.lang.String
getPath()
Path in the user's Dropbox to save the file.java.util.List<PropertyGroup>
getPropertyGroups()
List of custom properties to add to file.boolean
getStrictConflict()
Be more strict about how eachWriteMode
detects conflict.int
hashCode()
static CommitInfo.Builder
newBuilder(java.lang.String path)
Returns a new builder for creating an instance of this class.java.lang.String
toString()
java.lang.String
toStringMultiline()
Returns a String representation of this object formatted for easier readability.
-
-
-
Field Detail
-
path
protected final java.lang.String path
-
mode
protected final WriteMode mode
-
autorename
protected final boolean autorename
-
clientModified
protected final java.util.Date clientModified
-
mute
protected final boolean mute
-
propertyGroups
protected final java.util.List<PropertyGroup> propertyGroups
-
strictConflict
protected final boolean strictConflict
-
-
Constructor Detail
-
CommitInfo
public CommitInfo(java.lang.String path, WriteMode mode, boolean autorename, java.util.Date clientModified, boolean mute, java.util.List<PropertyGroup> propertyGroups, boolean strictConflict)
UsenewBuilder(java.lang.String)
to create instances of this class without specifying values for all optional fields.- Parameters:
path
- Path in the user's Dropbox to save the file. Must match pattern "(/(.|[\\r\\n])*)|(ns:[0-9]+(/.*)?)|(id:.*)
" and not benull
.mode
- Selects what to do if the file already exists. Must not benull
.autorename
- If there's a conflict, as determined bygetMode()
, have the Dropbox server try to autorename the file to avoid conflict.clientModified
- The value to store as thegetClientModified()
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.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.propertyGroups
- List of custom properties to add to file. Must not contain anull
item.strictConflict
- Be more strict about how eachWriteMode
detects conflict. For example, always return a conflict error whengetMode()
=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.- Throws:
java.lang.IllegalArgumentException
- If any argument does not meet its preconditions.
-
CommitInfo
public CommitInfo(java.lang.String path)
NoneThe default values for unset fields will be used.
- Parameters:
path
- Path in the user's Dropbox to save the file. Must match pattern "(/(.|[\\r\\n])*)|(ns:[0-9]+(/.*)?)|(id:.*)
" and not benull
.- Throws:
java.lang.IllegalArgumentException
- If any argument does not meet its preconditions.
-
-
Method Detail
-
getPath
public java.lang.String getPath()
Path in the user's Dropbox to save the file.- Returns:
- value for this field, never
null
.
-
getMode
public WriteMode getMode()
Selects what to do if the file already exists.- Returns:
- value for this field, or
null
if not present. Defaults to WriteMode.ADD.
-
getAutorename
public boolean getAutorename()
If there's a conflict, as determined bygetMode()
, have the Dropbox server try to autorename the file to avoid conflict.- Returns:
- value for this field, or
null
if not present. Defaults to false.
-
getClientModified
public java.util.Date getClientModified()
The value to store as thegetClientModified()
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:
- value for this field, or
null
if not present.
-
getMute
public boolean getMute()
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.- Returns:
- value for this field, or
null
if not present. Defaults to false.
-
getPropertyGroups
public java.util.List<PropertyGroup> getPropertyGroups()
List of custom properties to add to file.- Returns:
- value for this field, or
null
if not present.
-
getStrictConflict
public boolean getStrictConflict()
Be more strict about how eachWriteMode
detects conflict. For example, always return a conflict error whengetMode()
=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.- Returns:
- value for this field, or
null
if not present. Defaults to false.
-
newBuilder
public static CommitInfo.Builder newBuilder(java.lang.String path)
Returns a new builder for creating an instance of this class.- Parameters:
path
- Path in the user's Dropbox to save the file. Must match pattern "(/(.|[\\r\\n])*)|(ns:[0-9]+(/.*)?)|(id:.*)
" and not benull
.- Returns:
- builder for this class.
- Throws:
java.lang.IllegalArgumentException
- If any argument does not meet its preconditions.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
toStringMultiline
public java.lang.String toStringMultiline()
Returns a String representation of this object formatted for easier readability.The returned String may contain newlines.
- Returns:
- Formatted, multiline String representation of this object
-
-