Package com.dropbox.core.v2.files
Class CommitInfo
java.lang.Object
com.dropbox.core.v2.files.CommitInfo
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final booleanprotected final Dateprotected final WriteModeprotected final booleanprotected final Stringprotected final List<PropertyGroup> protected final boolean -
Constructor Summary
ConstructorsConstructorDescriptionCommitInfo(String path) NoneCommitInfo(String path, WriteMode mode, boolean autorename, Date clientModified, boolean mute, List<PropertyGroup> propertyGroups, boolean strictConflict) UsenewBuilder(java.lang.String)to create instances of this class without specifying values for all optional fields. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanIf there's a conflict, as determined bygetMode(), have the Dropbox server try to autorename the file to avoid conflict.The value to store as thegetClientModified()timestamp.getMode()Selects what to do if the file already exists.booleangetMute()Normally, users are made aware of any file modifications in their Dropbox account via notifications in the client software.getPath()Path in the user's Dropbox to save the file.List of custom properties to add to file.booleanBe more strict about how eachWriteModedetects conflict.inthashCode()static CommitInfo.BuildernewBuilder(String path) Returns a new builder for creating an instance of this class.toString()Returns a String representation of this object formatted for easier readability.
-
Field Details
-
path
-
mode
-
autorename
protected final boolean autorename -
clientModified
-
mute
protected final boolean mute -
propertyGroups
-
strictConflict
protected final boolean strictConflict
-
-
Constructor Details
-
CommitInfo
public CommitInfo(@Nonnull String path, @Nonnull WriteMode mode, boolean autorename, @Nullable Date clientModified, boolean mute, @Nullable 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]+(/(.|[\\r\\n])*)?)|(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 anullitem.strictConflict- Be more strict about how eachWriteModedetects 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:
IllegalArgumentException- If any argument does not meet its preconditions.
-
CommitInfo
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]+(/(.|[\\r\\n])*)?)|(id:.*)" and not benull.- Throws:
IllegalArgumentException- If any argument does not meet its preconditions.
-
-
Method Details
-
getPath
Path in the user's Dropbox to save the file.- Returns:
- value for this field, never
null.
-
getMode
Selects what to do if the file already exists.- Returns:
- value for this field, or
nullif 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
nullif not present. Defaults to false.
-
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
nullif 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
nullif not present. Defaults to false.
-
getPropertyGroups
List of custom properties to add to file.- Returns:
- value for this field, or
nullif not present.
-
getStrictConflict
public boolean getStrictConflict()Be more strict about how eachWriteModedetects 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
nullif not present. Defaults to false.
-
newBuilder
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]+(/(.|[\\r\\n])*)?)|(id:.*)" and not benull.- Returns:
- builder for this class.
- Throws:
IllegalArgumentException- If any argument does not meet its preconditions.
-
hashCode
public int hashCode() -
equals
-
toString
-
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
-