Class SharedLinkMetadata

java.lang.Object
com.dropbox.core.v2.sharing.SharedLinkMetadata
Direct Known Subclasses:
FileLinkMetadata, FolderLinkMetadata

public class SharedLinkMetadata extends Object
The metadata of a shared link.
  • Field Details

    • url

      @Nonnull protected final String url
    • id

      @Nullable protected final String id
    • name

      @Nonnull protected final String name
    • expires

      @Nullable protected final Date expires
    • pathLower

      @Nullable protected final String pathLower
    • linkPermissions

      @Nonnull protected final LinkPermissions linkPermissions
    • teamMemberInfo

      @Nullable protected final TeamMemberInfo teamMemberInfo
    • contentOwnerTeamInfo

      @Nullable protected final Team contentOwnerTeamInfo
  • Constructor Details

    • SharedLinkMetadata

      public SharedLinkMetadata(@Nonnull String url, @Nonnull String name, @Nonnull LinkPermissions linkPermissions, @Nullable String id, @Nullable Date expires, @Nullable String pathLower, @Nullable TeamMemberInfo teamMemberInfo, @Nullable Team contentOwnerTeamInfo)
      The metadata of a shared link.

      Use newBuilder(java.lang.String,java.lang.String,com.dropbox.core.v2.sharing.LinkPermissions) to create instances of this class without specifying values for all optional fields.

      Parameters:
      url - URL of the shared link. Must not be null.
      name - The linked file name (including extension). This never contains a slash. Must not be null.
      linkPermissions - The link's access permissions. Must not be null.
      id - A unique identifier for the linked file. Must have length of at least 1.
      expires - Expiration time, if set. By default the link won't expire.
      pathLower - The lowercased full path in the user's Dropbox. This always starts with a slash. This field will only be present only if the linked file is in the authenticated user's dropbox and the user is the owner of the link.
      teamMemberInfo - The team membership information of the link's owner. This field will only be present if the link's owner is a team member.
      contentOwnerTeamInfo - The team information of the content's owner. This field will only be present if the content's owner is a team member and the content's owner team is different from the link's owner team.
      Throws:
      IllegalArgumentException - If any argument does not meet its preconditions.
    • SharedLinkMetadata

      public SharedLinkMetadata(@Nonnull String url, @Nonnull String name, @Nonnull LinkPermissions linkPermissions)
      The metadata of a shared link.

      The default values for unset fields will be used.

      Parameters:
      url - URL of the shared link. Must not be null.
      name - The linked file name (including extension). This never contains a slash. Must not be null.
      linkPermissions - The link's access permissions. Must not be null.
      Throws:
      IllegalArgumentException - If any argument does not meet its preconditions.
  • Method Details

    • getUrl

      @Nonnull public String getUrl()
      URL of the shared link.
      Returns:
      value for this field, never null.
    • getName

      @Nonnull public String getName()
      The linked file name (including extension). This never contains a slash.
      Returns:
      value for this field, never null.
    • getLinkPermissions

      @Nonnull public LinkPermissions getLinkPermissions()
      The link's access permissions.
      Returns:
      value for this field, never null.
    • getId

      @Nullable public String getId()
      A unique identifier for the linked file.
      Returns:
      value for this field, or null if not present.
    • getExpires

      @Nullable public Date getExpires()
      Expiration time, if set. By default the link won't expire.
      Returns:
      value for this field, or null if not present.
    • getPathLower

      @Nullable public String getPathLower()
      The lowercased full path in the user's Dropbox. This always starts with a slash. This field will only be present only if the linked file is in the authenticated user's dropbox and the user is the owner of the link.
      Returns:
      value for this field, or null if not present.
    • getTeamMemberInfo

      @Nullable public TeamMemberInfo getTeamMemberInfo()
      The team membership information of the link's owner. This field will only be present if the link's owner is a team member.
      Returns:
      value for this field, or null if not present.
    • getContentOwnerTeamInfo

      @Nullable public Team getContentOwnerTeamInfo()
      The team information of the content's owner. This field will only be present if the content's owner is a team member and the content's owner team is different from the link's owner team.
      Returns:
      value for this field, or null if not present.
    • newBuilder

      public static SharedLinkMetadata.Builder newBuilder(String url, String name, LinkPermissions linkPermissions)
      Returns a new builder for creating an instance of this class.
      Parameters:
      url - URL of the shared link. Must not be null.
      name - The linked file name (including extension). This never contains a slash. Must not be null.
      linkPermissions - The link's access permissions. Must 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