Class SharedFileMetadata

java.lang.Object
com.dropbox.core.v2.sharing.SharedFileMetadata

public class SharedFileMetadata extends Object
Properties of the shared file.
  • Field Details

    • accessType

      @Nullable protected final AccessLevel accessType
    • id

      @Nonnull protected final String id
    • expectedLinkMetadata

      @Nullable protected final ExpectedSharedContentLinkMetadata expectedLinkMetadata
    • linkMetadata

      @Nullable protected final SharedContentLinkMetadata linkMetadata
    • name

      @Nonnull protected final String name
    • ownerDisplayNames

      @Nullable protected final List<String> ownerDisplayNames
    • ownerTeam

      @Nullable protected final Team ownerTeam
    • parentSharedFolderId

      @Nullable protected final String parentSharedFolderId
    • pathDisplay

      @Nullable protected final String pathDisplay
    • pathLower

      @Nullable protected final String pathLower
    • permissions

      @Nullable protected final List<FilePermission> permissions
    • policy

      @Nonnull protected final FolderPolicy policy
    • previewUrl

      @Nonnull protected final String previewUrl
    • timeInvited

      @Nullable protected final Date timeInvited
  • Constructor Details

    • SharedFileMetadata

      public SharedFileMetadata(@Nonnull String id, @Nonnull String name, @Nonnull FolderPolicy policy, @Nonnull String previewUrl, @Nullable AccessLevel accessType, @Nullable ExpectedSharedContentLinkMetadata expectedLinkMetadata, @Nullable SharedContentLinkMetadata linkMetadata, @Nullable List<String> ownerDisplayNames, @Nullable Team ownerTeam, @Nullable String parentSharedFolderId, @Nullable String pathDisplay, @Nullable String pathLower, @Nullable List<FilePermission> permissions, @Nullable Date timeInvited)
      Properties of the shared file.

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

      Parameters:
      id - The ID of the file. Must have length of at least 4, match pattern "id:.+", and not be null.
      name - The name of this file. Must not be null.
      policy - Policies governing this shared file. Must not be null.
      previewUrl - URL for displaying a web preview of the shared file. Must not be null.
      accessType - The current user's access level for this shared file.
      expectedLinkMetadata - The expected metadata of the link associated for the file when it is first shared. Absent if the link already exists. This is for an unreleased feature so it may not be returned yet.
      linkMetadata - The metadata of the link associated for the file. This is for an unreleased feature so it may not be returned yet.
      ownerDisplayNames - The display names of the users that own the file. If the file is part of a team folder, the display names of the team admins are also included. Absent if the owner display names cannot be fetched. Must not contain a null item.
      ownerTeam - The team that owns the file. This field is not present if the file is not owned by a team.
      parentSharedFolderId - The ID of the parent shared folder. This field is present only if the file is contained within a shared folder. Must match pattern "[-_0-9a-zA-Z:]+".
      pathDisplay - The cased path to be used for display purposes only. In rare instances the casing will not correctly match the user's filesystem, but this behavior will match the path provided in the Core API v1. Absent for unmounted files.
      pathLower - The lower-case full path of this file. Absent for unmounted files.
      permissions - The sharing permissions that requesting user has on this file. This corresponds to the entries given in the actions argument to DbxUserSharingRequests.getFileMetadataBatch(List,List) or the actions argument to DbxUserSharingRequests.getFileMetadata(String,List). Must not contain a null item.
      timeInvited - Timestamp indicating when the current user was invited to this shared file. If the user was not invited to the shared file, the timestamp will indicate when the user was invited to the parent shared folder. This value may be absent.
      Throws:
      IllegalArgumentException - If any argument does not meet its preconditions.
    • SharedFileMetadata

      public SharedFileMetadata(@Nonnull String id, @Nonnull String name, @Nonnull FolderPolicy policy, @Nonnull String previewUrl)
      Properties of the shared file.

      The default values for unset fields will be used.

      Parameters:
      id - The ID of the file. Must have length of at least 4, match pattern "id:.+", and not be null.
      name - The name of this file. Must not be null.
      policy - Policies governing this shared file. Must not be null.
      previewUrl - URL for displaying a web preview of the shared file. Must not be null.
      Throws:
      IllegalArgumentException - If any argument does not meet its preconditions.
  • Method Details

    • getId

      @Nonnull public String getId()
      The ID of the file.
      Returns:
      value for this field, never null.
    • getName

      @Nonnull public String getName()
      The name of this file.
      Returns:
      value for this field, never null.
    • getPolicy

      @Nonnull public FolderPolicy getPolicy()
      Policies governing this shared file.
      Returns:
      value for this field, never null.
    • getPreviewUrl

      @Nonnull public String getPreviewUrl()
      URL for displaying a web preview of the shared file.
      Returns:
      value for this field, never null.
    • getAccessType

      @Nullable public AccessLevel getAccessType()
      The current user's access level for this shared file.
      Returns:
      value for this field, or null if not present.
    • getExpectedLinkMetadata

      @Nullable public ExpectedSharedContentLinkMetadata getExpectedLinkMetadata()
      The expected metadata of the link associated for the file when it is first shared. Absent if the link already exists. This is for an unreleased feature so it may not be returned yet.
      Returns:
      value for this field, or null if not present.
    • getLinkMetadata

      @Nullable public SharedContentLinkMetadata getLinkMetadata()
      The metadata of the link associated for the file. This is for an unreleased feature so it may not be returned yet.
      Returns:
      value for this field, or null if not present.
    • getOwnerDisplayNames

      @Nullable public List<String> getOwnerDisplayNames()
      The display names of the users that own the file. If the file is part of a team folder, the display names of the team admins are also included. Absent if the owner display names cannot be fetched.
      Returns:
      value for this field, or null if not present.
    • getOwnerTeam

      @Nullable public Team getOwnerTeam()
      The team that owns the file. This field is not present if the file is not owned by a team.
      Returns:
      value for this field, or null if not present.
    • getParentSharedFolderId

      @Nullable public String getParentSharedFolderId()
      The ID of the parent shared folder. This field is present only if the file is contained within a shared folder.
      Returns:
      value for this field, or null if not present.
    • getPathDisplay

      @Nullable public String getPathDisplay()
      The cased path to be used for display purposes only. In rare instances the casing will not correctly match the user's filesystem, but this behavior will match the path provided in the Core API v1. Absent for unmounted files.
      Returns:
      value for this field, or null if not present.
    • getPathLower

      @Nullable public String getPathLower()
      The lower-case full path of this file. Absent for unmounted files.
      Returns:
      value for this field, or null if not present.
    • getPermissions

      @Nullable public List<FilePermission> getPermissions()
      The sharing permissions that requesting user has on this file. This corresponds to the entries given in the actions argument to DbxUserSharingRequests.getFileMetadataBatch(List,List) or the actions argument to DbxUserSharingRequests.getFileMetadata(String,List).
      Returns:
      value for this field, or null if not present.
    • getTimeInvited

      @Nullable public Date getTimeInvited()
      Timestamp indicating when the current user was invited to this shared file. If the user was not invited to the shared file, the timestamp will indicate when the user was invited to the parent shared folder. This value may be absent.
      Returns:
      value for this field, or null if not present.
    • newBuilder

      public static SharedFileMetadata.Builder newBuilder(String id, String name, FolderPolicy policy, String previewUrl)
      Returns a new builder for creating an instance of this class.
      Parameters:
      id - The ID of the file. Must have length of at least 4, match pattern "id:.+", and not be null.
      name - The name of this file. Must not be null.
      policy - Policies governing this shared file. Must not be null.
      previewUrl - URL for displaying a web preview of the shared file. 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