Package com.dropbox.core.v2.files
Class FileMetadata
- java.lang.Object
- 
- com.dropbox.core.v2.files.Metadata
- 
- com.dropbox.core.v2.files.FileMetadata
 
 
- 
 public class FileMetadata extends Metadata 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classFileMetadata.BuilderBuilder forFileMetadata.
 - 
Field SummaryFields Modifier and Type Field Description protected java.util.DateclientModifiedprotected java.lang.StringcontentHashprotected ExportInfoexportInfoprotected FileLockMetadatafileLockInfoprotected java.lang.BooleanhasExplicitSharedMembersprotected java.lang.Stringidprotected booleanisDownloadableprotected MediaInfomediaInfoprotected java.util.List<PropertyGroup>propertyGroupsprotected java.lang.Stringrevprotected java.util.DateserverModifiedprotected FileSharingInfosharingInfoprotected longsizeprotected SymlinkInfosymlinkInfo- 
Fields inherited from class com.dropbox.core.v2.files.Metadataname, parentSharedFolderId, pathDisplay, pathLower
 
- 
 - 
Constructor SummaryConstructors Constructor Description FileMetadata(java.lang.String name, java.lang.String id, java.util.Date clientModified, java.util.Date serverModified, java.lang.String rev, long size)NoneFileMetadata(java.lang.String name, java.lang.String id, java.util.Date clientModified, java.util.Date serverModified, java.lang.String rev, long size, java.lang.String pathLower, java.lang.String pathDisplay, java.lang.String parentSharedFolderId, MediaInfo mediaInfo, SymlinkInfo symlinkInfo, FileSharingInfo sharingInfo, boolean isDownloadable, ExportInfo exportInfo, java.util.List<PropertyGroup> propertyGroups, java.lang.Boolean hasExplicitSharedMembers, java.lang.String contentHash, FileLockMetadata fileLockInfo)UsenewBuilder(java.lang.String,java.lang.String,java.util.Date,java.util.Date,java.lang.String,long)to create instances of this class without specifying values for all optional fields.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)java.util.DategetClientModified()For files, this is the modification time set by the desktop client when the file was added to Dropbox.java.lang.StringgetContentHash()A hash of the file content.ExportInfogetExportInfo()Information about format this file can be exported to.FileLockMetadatagetFileLockInfo()If present, the metadata associated with the file's current lock.java.lang.BooleangetHasExplicitSharedMembers()This flag will only be present if include_has_explicit_shared_members is true inDbxUserFilesRequests.listFolder(String)orDbxUserFilesRequests.getMetadata(String).java.lang.StringgetId()A unique identifier for the file.booleangetIsDownloadable()If true, file can be downloaded directly; else the file must be exported.MediaInfogetMediaInfo()Additional information if the file is a photo or video.java.lang.StringgetName()The last component of the path (including extension).java.lang.StringgetParentSharedFolderId()Please useFileSharingInfo.getParentSharedFolderId()orFolderSharingInfo.getParentSharedFolderId()instead.java.lang.StringgetPathDisplay()The cased path to be used for display purposes only.java.lang.StringgetPathLower()The lowercased full path in the user's Dropbox.java.util.List<PropertyGroup>getPropertyGroups()Additional information if the file has custom properties with the property template specified.java.lang.StringgetRev()A unique identifier for the current revision of a file.java.util.DategetServerModified()The last time the file was modified on Dropbox.FileSharingInfogetSharingInfo()Set if this file is contained in a shared folder.longgetSize()The file size in bytes.SymlinkInfogetSymlinkInfo()Set if this file is a symlink.inthashCode()static FileMetadata.BuildernewBuilder(java.lang.String name, java.lang.String id, java.util.Date clientModified, java.util.Date serverModified, java.lang.String rev, long size)Returns a new builder for creating an instance of this class.java.lang.StringtoString()java.lang.StringtoStringMultiline()Returns a String representation of this object formatted for easier readability.- 
Methods inherited from class com.dropbox.core.v2.files.MetadatanewBuilder
 
- 
 
- 
- 
- 
Field Detail- 
idprotected final java.lang.String id 
 - 
clientModifiedprotected final java.util.Date clientModified 
 - 
serverModifiedprotected final java.util.Date serverModified 
 - 
revprotected final java.lang.String rev 
 - 
sizeprotected final long size 
 - 
mediaInfoprotected final MediaInfo mediaInfo 
 - 
symlinkInfoprotected final SymlinkInfo symlinkInfo 
 - 
sharingInfoprotected final FileSharingInfo sharingInfo 
 - 
isDownloadableprotected final boolean isDownloadable 
 - 
exportInfoprotected final ExportInfo exportInfo 
 - 
propertyGroupsprotected final java.util.List<PropertyGroup> propertyGroups 
 - 
hasExplicitSharedMembersprotected final java.lang.Boolean hasExplicitSharedMembers 
 - 
contentHashprotected final java.lang.String contentHash 
 - 
fileLockInfoprotected final FileLockMetadata fileLockInfo 
 
- 
 - 
Constructor Detail- 
FileMetadatapublic FileMetadata(java.lang.String name, java.lang.String id, java.util.Date clientModified, java.util.Date serverModified, java.lang.String rev, long size, java.lang.String pathLower, java.lang.String pathDisplay, java.lang.String parentSharedFolderId, MediaInfo mediaInfo, SymlinkInfo symlinkInfo, FileSharingInfo sharingInfo, boolean isDownloadable, ExportInfo exportInfo, java.util.List<PropertyGroup> propertyGroups, java.lang.Boolean hasExplicitSharedMembers, java.lang.String contentHash, FileLockMetadata fileLockInfo)UsenewBuilder(java.lang.String,java.lang.String,java.util.Date,java.util.Date,java.lang.String,long)to create instances of this class without specifying values for all optional fields.- Parameters:
- 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, and at least the last path component will have the correct casing. Changes to only 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- 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. This field will not be set on entries returned by- DbxUserFilesRequests.listFolder(String),- DbxUserFilesRequests.listFolderContinue(String), or- DbxUserFilesRequests.getThumbnailBatch(List), starting December 2, 2019.
- symlinkInfo- Set if this file is a symlink.
- sharingInfo- Set if this file is contained in a shared folder.
- isDownloadable- If true, file can be downloaded directly; else the file must be exported.
- exportInfo- Information about format this file can be exported to. This filed must be set if- getIsDownloadable()is set to false.
- propertyGroups- Additional information if the file has custom properties with the property template specified. Must not contain a- nullitem.
- 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.
- contentHash- A hash of the file content. This field can be used to verify data integrity. For more information see our Content hash page. Must have length of at least 64 and have length of at most 64.
- fileLockInfo- If present, the metadata associated with the file's current lock.
- Throws:
- java.lang.IllegalArgumentException- If any argument does not meet its preconditions.
 
 - 
FileMetadatapublic FileMetadata(java.lang.String name, java.lang.String id, java.util.Date clientModified, java.util.Date serverModified, java.lang.String rev, long size)NoneThe default values for unset fields will be used. - Parameters:
- 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.
- Throws:
- java.lang.IllegalArgumentException- If any argument does not meet its preconditions.
 
 
- 
 - 
Method Detail- 
getNamepublic java.lang.String getName() The last component of the path (including extension). This never contains a slash.
 - 
getIdpublic java.lang.String getId() A unique identifier for the file.- Returns:
- value for this field, never null.
 
 - 
getClientModifiedpublic java.util.Date getClientModified() 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.- Returns:
- value for this field, never null.
 
 - 
getServerModifiedpublic java.util.Date getServerModified() The last time the file was modified on Dropbox.- Returns:
- value for this field, never null.
 
 - 
getRevpublic java.lang.String getRev() 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.- Returns:
- value for this field, never null.
 
 - 
getSizepublic long getSize() The file size in bytes.- Returns:
- value for this field.
 
 - 
getPathLowerpublic java.lang.String getPathLower() 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.- Overrides:
- getPathLowerin class- Metadata
- Returns:
- value for this field, or nullif not present.
 
 - 
getPathDisplaypublic java.lang.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, and at least the last path component will have the correct casing. Changes to only the casing of paths won't be returned byDbxUserFilesRequests.listFolderContinue(String). This field will be null if the file or folder is not mounted.- Overrides:
- getPathDisplayin class- Metadata
- Returns:
- value for this field, or nullif not present.
 
 - 
getParentSharedFolderIdpublic java.lang.String getParentSharedFolderId() Please useFileSharingInfo.getParentSharedFolderId()orFolderSharingInfo.getParentSharedFolderId()instead.- Overrides:
- getParentSharedFolderIdin class- Metadata
- Returns:
- value for this field, or nullif not present.
 
 - 
getMediaInfopublic MediaInfo getMediaInfo() Additional information if the file is a photo or video. This field will not be set on entries returned byDbxUserFilesRequests.listFolder(String),DbxUserFilesRequests.listFolderContinue(String), orDbxUserFilesRequests.getThumbnailBatch(List), starting December 2, 2019.- Returns:
- value for this field, or nullif not present.
 
 - 
getSymlinkInfopublic SymlinkInfo getSymlinkInfo() Set if this file is a symlink.- Returns:
- value for this field, or nullif not present.
 
 - 
getSharingInfopublic FileSharingInfo getSharingInfo() Set if this file is contained in a shared folder.- Returns:
- value for this field, or nullif not present.
 
 - 
getIsDownloadablepublic boolean getIsDownloadable() If true, file can be downloaded directly; else the file must be exported.- Returns:
- value for this field, or nullif not present. Defaults to true.
 
 - 
getExportInfopublic ExportInfo getExportInfo() Information about format this file can be exported to. This filed must be set ifgetIsDownloadable()is set to false.- Returns:
- value for this field, or nullif not present.
 
 - 
getPropertyGroupspublic java.util.List<PropertyGroup> getPropertyGroups() Additional information if the file has custom properties with the property template specified.- Returns:
- value for this field, or nullif not present.
 
 - 
getHasExplicitSharedMemberspublic java.lang.Boolean getHasExplicitSharedMembers() This flag will only be present if include_has_explicit_shared_members is true inDbxUserFilesRequests.listFolder(String)orDbxUserFilesRequests.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.- Returns:
- value for this field, or nullif not present.
 
 - 
getContentHashpublic java.lang.String getContentHash() A hash of the file content. This field can be used to verify data integrity. For more information see our Content hash page.- Returns:
- value for this field, or nullif not present.
 
 - 
getFileLockInfopublic FileLockMetadata getFileLockInfo() If present, the metadata associated with the file's current lock.- Returns:
- value for this field, or nullif not present.
 
 - 
newBuilderpublic static FileMetadata.Builder newBuilder(java.lang.String name, java.lang.String id, java.util.Date clientModified, java.util.Date serverModified, java.lang.String rev, long size) Returns a new builder for creating an instance of this class.- Parameters:
- 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.
- Returns:
- builder for this class.
- Throws:
- java.lang.IllegalArgumentException- If any argument does not meet its preconditions.
 
 - 
toStringMultilinepublic java.lang.String toStringMultiline() Returns a String representation of this object formatted for easier readability.The returned String may contain newlines. - Overrides:
- toStringMultilinein class- Metadata
- Returns:
- Formatted, multiline String representation of this object
 
 
- 
 
-