public class SharedFileMetadata extends Object
Modifier and Type | Class and Description |
---|---|
static class |
SharedFileMetadata.Builder
Builder for
SharedFileMetadata . |
Modifier and Type | Field and Description |
---|---|
protected String |
id |
protected String |
name |
protected Team |
ownerTeam |
protected String |
parentSharedFolderId |
protected String |
pathDisplay |
protected String |
pathLower |
protected List<FilePermission> |
permissions |
protected FolderPolicy |
policy |
protected String |
previewUrl |
protected Date |
timeInvited |
Constructor and Description |
---|
SharedFileMetadata(FolderPolicy policy,
String previewUrl,
String name,
String id)
Properties of the shared file.
|
SharedFileMetadata(FolderPolicy policy,
String previewUrl,
String name,
String id,
List<FilePermission> permissions,
Team ownerTeam,
String parentSharedFolderId,
String pathLower,
String pathDisplay,
Date timeInvited)
Properties of the shared file.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
String |
getId()
The ID of the file.
|
String |
getName()
The name of this file.
|
Team |
getOwnerTeam()
The team that owns the file.
|
String |
getParentSharedFolderId()
The ID of the parent shared folder.
|
String |
getPathDisplay()
The cased path to be used for display purposes only.
|
String |
getPathLower()
The lower-case full path of this file.
|
List<FilePermission> |
getPermissions()
The sharing permissions that requesting user has on this file.
|
FolderPolicy |
getPolicy()
Policies governing this shared file.
|
String |
getPreviewUrl()
URL for displaying a web preview of the shared file.
|
Date |
getTimeInvited()
Timestamp indicating when the current user was invited to this shared
file.
|
int |
hashCode() |
static SharedFileMetadata.Builder |
newBuilder(FolderPolicy policy,
String previewUrl,
String name,
String id)
Returns a new builder for creating an instance of this class.
|
String |
toString() |
String |
toStringMultiline()
Returns a String representation of this object formatted for easier
readability.
|
protected final FolderPolicy policy
protected final List<FilePermission> permissions
protected final Team ownerTeam
protected final String parentSharedFolderId
protected final String previewUrl
protected final String pathLower
protected final String pathDisplay
protected final String name
protected final String id
protected final Date timeInvited
public SharedFileMetadata(FolderPolicy policy, String previewUrl, String name, String id, List<FilePermission> permissions, Team ownerTeam, String parentSharedFolderId, String pathLower, String pathDisplay, Date timeInvited)
Use newBuilder
to create instances of this class without
specifying values for all optional fields.
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
.name
- The name of this file. Must not be null
.id
- The ID of the file. Must have length of at least 1, match
pattern "id:.*
", and not be null
.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.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:]+
".pathLower
- The lower-case full path of this file. Absent for
unmounted files.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.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.IllegalArgumentException
- If any argument does not meet its
preconditions.public SharedFileMetadata(FolderPolicy policy, String previewUrl, String name, String id)
The default values for unset fields will be used.
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
.name
- The name of this file. Must not be null
.id
- The ID of the file. Must have length of at least 1, match
pattern "id:.*
", and not be null
.IllegalArgumentException
- If any argument does not meet its
preconditions.public FolderPolicy getPolicy()
null
.public String getPreviewUrl()
null
.public String getName()
null
.public String getId()
null
.public List<FilePermission> getPermissions()
actions
argument to
DbxUserSharingRequests.getFileMetadataBatch(List,List)
or the
actions
argument to DbxUserSharingRequests.getFileMetadata(String,List)
.null
if not present.public Team getOwnerTeam()
null
if not present.public String getParentSharedFolderId()
null
if not present.public String getPathLower()
null
if not present.public String getPathDisplay()
null
if not present.public Date getTimeInvited()
null
if not present.public static SharedFileMetadata.Builder newBuilder(FolderPolicy policy, String previewUrl, String name, String id)
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
.name
- The name of this file. Must not be null
.id
- The ID of the file. Must have length of at least 1, match
pattern "id:.*
", and not be null
.IllegalArgumentException
- If any argument does not meet its
preconditions.public String toStringMultiline()
The returned String may contain newlines.