Package com.dropbox.core.v2.files
Class FileMetadata
java.lang.Object
com.dropbox.core.v2.files.Metadata
com.dropbox.core.v2.files.FileMetadata
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Dateprotected final Stringprotected final ExportInfoprotected final FileLockMetadataprotected final Booleanprotected final Stringprotected final booleanprotected final MediaInfoprotected final List<PropertyGroup> protected final Stringprotected final Dateprotected final FileSharingInfoprotected final longprotected final SymlinkInfoFields inherited from class com.dropbox.core.v2.files.Metadata
name, parentSharedFolderId, pathDisplay, pathLower, previewUrl -
Constructor Summary
ConstructorsConstructorDescriptionFileMetadata(String name, String id, Date clientModified, Date serverModified, String rev, long size) NoneFileMetadata(String name, String id, Date clientModified, Date serverModified, String rev, long size, String pathLower, String pathDisplay, String parentSharedFolderId, String previewUrl, MediaInfo mediaInfo, SymlinkInfo symlinkInfo, FileSharingInfo sharingInfo, boolean isDownloadable, ExportInfo exportInfo, List<PropertyGroup> propertyGroups, Boolean hasExplicitSharedMembers, 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 Summary
Modifier and TypeMethodDescriptionbooleanFor files, this is the modification time set by the desktop client when the file was added to Dropbox.A hash of the file content.Information about format this file can be exported to.If present, the metadata associated with the file's current lock.This flag will only be present if include_has_explicit_shared_members is true inDbxAppFilesRequests.listFolder(String)orDbxUserFilesRequests.getMetadata(String).getId()A unique identifier for the file.booleanIf true, file can be downloaded directly; else the file must be exported.Additional information if the file is a photo or video.getName()The last component of the path (including extension).Deprecated.The cased path to be used for display purposes only.The lowercased full path in the user's Dropbox.The preview URL of the file.Additional information if the file has custom properties with the property template specified.getRev()A unique identifier for the current revision of a file.The last time the file was modified on Dropbox.Set if this file is contained in a shared folder.longgetSize()The file size in bytes.Set if this file is a symlink.inthashCode()static FileMetadata.BuilderReturns a new builder for creating an instance of this class.toString()Returns a String representation of this object formatted for easier readability.Methods inherited from class com.dropbox.core.v2.files.Metadata
newBuilder
-
Field Details
-
id
-
clientModified
-
serverModified
-
rev
-
size
protected final long size -
mediaInfo
-
symlinkInfo
-
sharingInfo
-
isDownloadable
protected final boolean isDownloadable -
exportInfo
-
propertyGroups
-
contentHash
-
fileLockInfo
-
-
Constructor Details
-
FileMetadata
public FileMetadata(@Nonnull String name, @Nonnull String id, @Nonnull Date clientModified, @Nonnull Date serverModified, @Nonnull String rev, long size, @Nullable String pathLower, @Nullable String pathDisplay, @Nullable String parentSharedFolderId, @Nullable String previewUrl, @Nullable MediaInfo mediaInfo, @Nullable SymlinkInfo symlinkInfo, @Nullable FileSharingInfo sharingInfo, boolean isDownloadable, @Nullable ExportInfo exportInfo, @Nullable List<PropertyGroup> propertyGroups, @Nullable Boolean hasExplicitSharedMembers, @Nullable String contentHash, @Nullable 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 benull.id- A unique identifier for the file. Must have length of at least 1 and not benull.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 benull.serverModified- The last time the file was modified on Dropbox. Must not benull.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 benull.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 byDbxAppFilesRequests.listFolderContinue(String). This field will be null if the file or folder is not mounted.parentSharedFolderId- Field is deprecated. Please useFileSharingInfo.getParentSharedFolderId()orFolderSharingInfo.getParentSharedFolderId()instead. Must match pattern "[-_0-9a-zA-Z:]+".previewUrl- The preview URL of the file.mediaInfo- Additional information if the file is a photo or video. This field will not be set on entries returned byDbxAppFilesRequests.listFolder(String),DbxAppFilesRequests.listFolderContinue(String), orDbxUserFilesRequests.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 ifgetIsDownloadable()is set to false.propertyGroups- Additional information if the file has custom properties with the property template specified. Must not contain anullitem.hasExplicitSharedMembers- This flag will only be present if include_has_explicit_shared_members is true inDbxAppFilesRequests.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.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:
IllegalArgumentException- If any argument does not meet its preconditions.
-
FileMetadata
public FileMetadata(@Nonnull String name, @Nonnull String id, @Nonnull Date clientModified, @Nonnull Date serverModified, @Nonnull 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 benull.id- A unique identifier for the file. Must have length of at least 1 and not benull.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 benull.serverModified- The last time the file was modified on Dropbox. Must not benull.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 benull.size- The file size in bytes.- Throws:
IllegalArgumentException- If any argument does not meet its preconditions.
-
-
Method Details
-
getName
The last component of the path (including extension). This never contains a slash. -
getId
A unique identifier for the file.- Returns:
- value for this field, never
null.
-
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.
-
getServerModified
The last time the file was modified on Dropbox.- Returns:
- value for this field, never
null.
-
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.
-
getSize
public long getSize()The file size in bytes.- Returns:
- value for this field.
-
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 classMetadata- Returns:
- value for this field, or
nullif not present.
-
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 byDbxAppFilesRequests.listFolderContinue(String). This field will be null if the file or folder is not mounted.- Overrides:
getPathDisplayin classMetadata- Returns:
- value for this field, or
nullif not present.
-
getPreviewUrl
The preview URL of the file.- Overrides:
getPreviewUrlin classMetadata- Returns:
- value for this field, or
nullif not present.
-
getMediaInfo
Additional information if the file is a photo or video. This field will not be set on entries returned byDbxAppFilesRequests.listFolder(String),DbxAppFilesRequests.listFolderContinue(String), orDbxUserFilesRequests.getThumbnailBatch(List), starting December 2, 2019.- Returns:
- value for this field, or
nullif not present.
-
getSymlinkInfo
Set if this file is a symlink.- Returns:
- value for this field, or
nullif not present.
-
getSharingInfo
Set if this file is contained in a shared folder.- Returns:
- value for this field, or
nullif not present.
-
getIsDownloadable
public 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.
-
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.
-
getPropertyGroups
Additional information if the file has custom properties with the property template specified.- Returns:
- value for this field, or
nullif not present.
-
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.
-
getFileLockInfo
If present, the metadata associated with the file's current lock.- Returns:
- value for this field, or
nullif not present.
-
newBuilder
public 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.- Parameters:
name- The last component of the path (including extension). This never contains a slash. Must not benull.id- A unique identifier for the file. Must have length of at least 1 and not benull.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 benull.serverModified- The last time the file was modified on Dropbox. Must not benull.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 benull.size- The file size in bytes.- Returns:
- builder for this class.
- Throws:
IllegalArgumentException- If any argument does not meet its preconditions.
-
hashCode
public int hashCode() -
equals
-
toString
-
toStringMultiline
Returns a String representation of this object formatted for easier readability.The returned String may contain newlines.
- Overrides:
toStringMultilinein classMetadata- Returns:
- Formatted, multiline String representation of this object
-