Class CommitInfo

java.lang.Object
com.dropbox.core.v2.files.CommitInfo

public class CommitInfo extends Object
  • Field Details

    • path

      @Nonnull protected final String path
    • mode

      @Nonnull protected final WriteMode mode
    • autorename

      protected final boolean autorename
    • clientModified

      @Nullable protected final Date clientModified
    • mute

      protected final boolean mute
    • propertyGroups

      @Nullable protected final List<PropertyGroup> 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)
      Use newBuilder(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 be null.
      mode - Selects what to do if the file already exists. Must not be null.
      autorename - If there's a conflict, as determined by getMode(), have the Dropbox server try to autorename the file to avoid conflict.
      clientModified - The value to store as the 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.
      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.
      propertyGroups - List of custom properties to add to file. Must not contain a null item.
      strictConflict - Be more strict about how each WriteMode detects conflict. For example, always return a conflict error when 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.
      Throws:
      IllegalArgumentException - If any argument does not meet its preconditions.
    • CommitInfo

      public CommitInfo(@Nonnull String path)
      None

      The 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 be null.
      Throws:
      IllegalArgumentException - If any argument does not meet its preconditions.
  • Method Details

    • getPath

      @Nonnull public String getPath()
      Path in the user's Dropbox to save the file.
      Returns:
      value for this field, never null.
    • getMode

      @Nonnull 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 by getMode(), 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

      @Nullable public Date getClientModified()
      The value to store as the 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:
      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. If true, 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

      @Nullable public 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 each WriteMode detects conflict. For example, always return a conflict error when 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.
      Returns:
      value for this field, or null if not present. Defaults to false.
    • newBuilder

      public static CommitInfo.Builder newBuilder(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]+(/(.|[\\r\\n])*)?)|(id:.*)" and not be null.
      Returns:
      builder for this class.
      Throws:
      IllegalArgumentException - If any argument does not meet its preconditions.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toStringMultiline

      public 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