public class FileMetadata extends Metadata
Modifier and Type | Class and Description |
---|---|
static class |
FileMetadata.Builder
Builder for
FileMetadata . |
Modifier and Type | Field and Description |
---|---|
protected Date |
clientModified |
protected Boolean |
hasExplicitSharedMembers |
protected String |
id |
protected MediaInfo |
mediaInfo |
protected List<PropertyGroup> |
propertyGroups |
protected String |
rev |
protected Date |
serverModified |
protected FileSharingInfo |
sharingInfo |
protected long |
size |
name, parentSharedFolderId, pathDisplay, pathLower
Constructor and Description |
---|
FileMetadata(String name,
String id,
Date clientModified,
Date serverModified,
String rev,
long size)
None
|
FileMetadata(String name,
String id,
Date clientModified,
Date serverModified,
String rev,
long size,
String pathLower,
String pathDisplay,
String parentSharedFolderId,
MediaInfo mediaInfo,
FileSharingInfo sharingInfo,
List<PropertyGroup> propertyGroups,
Boolean hasExplicitSharedMembers)
Use
newBuilder to create instances of this class without
specifying values for all optional fields. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
Date |
getClientModified()
For files, this is the modification time set by the desktop client when
the file was added to Dropbox.
|
Boolean |
getHasExplicitSharedMembers()
This flag will only be present if include_has_explicit_shared_members is
true in
DbxUserFilesRequests.listFolder(String) or DbxUserFilesRequests.getMetadata(String) . |
String |
getId()
A unique identifier for the file.
|
MediaInfo |
getMediaInfo()
Additional information if the file is a photo or video.
|
String |
getName()
The last component of the path (including extension).
|
String |
getParentSharedFolderId()
Deprecated.
|
String |
getPathDisplay()
The cased path to be used for display purposes only.
|
String |
getPathLower()
The lowercased full path in the user's Dropbox.
|
List<PropertyGroup> |
getPropertyGroups()
Additional information if the file has custom properties with the
property template specified.
|
String |
getRev()
A unique identifier for the current revision of a file.
|
Date |
getServerModified()
The last time the file was modified on Dropbox.
|
FileSharingInfo |
getSharingInfo()
Set if this file is contained in a shared folder.
|
long |
getSize()
The file size in bytes.
|
int |
hashCode() |
static FileMetadata.Builder |
newBuilder(String name,
String id,
Date clientModified,
Date serverModified,
String rev,
long size)
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.
|
newBuilder
protected final String id
protected final Date clientModified
protected final Date serverModified
protected final String rev
protected final long size
protected final MediaInfo mediaInfo
protected final FileSharingInfo sharingInfo
protected final List<PropertyGroup> propertyGroups
protected final Boolean hasExplicitSharedMembers
public FileMetadata(String name, String id, Date clientModified, Date serverModified, String rev, long size, String pathLower, String pathDisplay, String parentSharedFolderId, MediaInfo mediaInfo, FileSharingInfo sharingInfo, List<PropertyGroup> propertyGroups, Boolean hasExplicitSharedMembers)
newBuilder
to create instances of this class without
specifying values for all optional fields.name
- The last component of the path (including extension). This
never contains a slash. Must not be null
.id
- A unique identifier for the file. Must have length of at least
1 and not be null
.clientModified
- For files, this is the modification time set by
the desktop client when the file was added to Dropbox. Since this
time is not verified (the Dropbox server stores whatever the desktop
client sends up), this should only be used for display purposes (such
as sorting) and not, for example, to determine if a file has changed
or not. Must not be null
.serverModified
- The last time the file was modified on Dropbox.
Must not be null
.rev
- A unique identifier for the current revision of a file. This
field is the same rev as elsewhere in the API and can be used to
detect changes and avoid conflicts. Must have length of at least 9,
match pattern "[0-9a-f]+
", and not be null
.size
- The file size in bytes.pathLower
- The lowercased full path in the user's Dropbox. This
always starts with a slash. This field will be null if the file or
folder is not mounted.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. Changes to the casing of paths won't be returned by
DbxUserFilesRequests.listFolderContinue(String)
. This field
will be null if the file or folder is not mounted.parentSharedFolderId
- Deprecated. Please use FileSharingInfo.getParentSharedFolderId()
or FolderSharingInfo.getParentSharedFolderId()
instead. Must match
pattern "[-_0-9a-zA-Z:]+
".mediaInfo
- Additional information if the file is a photo or video.sharingInfo
- Set if this file is contained in a shared folder.propertyGroups
- Additional information if the file has custom
properties with the property template specified. Must not contain a
null
item.hasExplicitSharedMembers
- This flag will only be present if
include_has_explicit_shared_members is true in DbxUserFilesRequests.listFolder(String)
or DbxUserFilesRequests.getMetadata(String)
. If this flag is present,
it will be true if this file has any explicit shared members. This
is different from sharing_info in that this could be true in the
case where a file has explicit members but is not contained within a
shared folder.IllegalArgumentException
- If any argument does not meet its
preconditions.public FileMetadata(String name, String id, Date clientModified, Date serverModified, String rev, long size)
The default values for unset fields will be used.
name
- The last component of the path (including extension). This
never contains a slash. Must not be null
.id
- A unique identifier for the file. Must have length of at least
1 and not be null
.clientModified
- For files, this is the modification time set by
the desktop client when the file was added to Dropbox. Since this
time is not verified (the Dropbox server stores whatever the desktop
client sends up), this should only be used for display purposes (such
as sorting) and not, for example, to determine if a file has changed
or not. Must not be null
.serverModified
- The last time the file was modified on Dropbox.
Must not be null
.rev
- A unique identifier for the current revision of a file. This
field is the same rev as elsewhere in the API and can be used to
detect changes and avoid conflicts. Must have length of at least 9,
match pattern "[0-9a-f]+
", and not be null
.size
- The file size in bytes.IllegalArgumentException
- If any argument does not meet its
preconditions.public String getName()
public String getId()
null
.public Date getClientModified()
null
.public Date getServerModified()
null
.public String getRev()
null
.public long getSize()
public String getPathLower()
getPathLower
in class Metadata
null
if not present.public String getPathDisplay()
DbxUserFilesRequests.listFolderContinue(String)
. This field will be null
if the file or folder is not mounted.getPathDisplay
in class Metadata
null
if not present.public String getParentSharedFolderId()
FileSharingInfo.getParentSharedFolderId()
or
FolderSharingInfo.getParentSharedFolderId()
instead.getParentSharedFolderId
in class Metadata
null
if not present.public MediaInfo getMediaInfo()
null
if not present.public FileSharingInfo getSharingInfo()
null
if not present.public List<PropertyGroup> getPropertyGroups()
null
if not present.public Boolean getHasExplicitSharedMembers()
DbxUserFilesRequests.listFolder(String)
or DbxUserFilesRequests.getMetadata(String)
. If this flag is present, it
will be true if this file has any explicit shared members. This is
different from sharing_info in that this could be true in the case where
a file has explicit members but is not contained within a shared folder.null
if not present.public static FileMetadata.Builder newBuilder(String name, String id, Date clientModified, Date serverModified, String rev, long size)
name
- The last component of the path (including extension). This
never contains a slash. Must not be null
.id
- A unique identifier for the file. Must have length of at least
1 and not be null
.clientModified
- For files, this is the modification time set by
the desktop client when the file was added to Dropbox. Since this
time is not verified (the Dropbox server stores whatever the desktop
client sends up), this should only be used for display purposes (such
as sorting) and not, for example, to determine if a file has changed
or not. Must not be null
.serverModified
- The last time the file was modified on Dropbox.
Must not be null
.rev
- A unique identifier for the current revision of a file. This
field is the same rev as elsewhere in the API and can be used to
detect changes and avoid conflicts. Must have length of at least 9,
match pattern "[0-9a-f]+
", and not be null
.size
- The file size in bytes.IllegalArgumentException
- If any argument does not meet its
preconditions.public String toStringMultiline()
The returned String may contain newlines.
toStringMultiline
in class Metadata