Package com.dropbox.core.v2.files
Class FileMetadata.Builder
java.lang.Object
com.dropbox.core.v2.files.Metadata.Builder
com.dropbox.core.v2.files.FileMetadata.Builder
- Enclosing class:
FileMetadata
Builder for
FileMetadata.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Dateprotected Stringprotected ExportInfoprotected FileLockMetadataprotected Booleanprotected final Stringprotected booleanprotected Booleanprotected MediaInfoprotected List<PropertyGroup> protected final Stringprotected final Dateprotected FileSharingInfoprotected final longprotected SymlinkInfoFields inherited from class com.dropbox.core.v2.files.Metadata.Builder
name, parentSharedFolderId, pathDisplay, pathLower, previewUrl -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds an instance ofFileMetadataconfigured with this builder's valueswithContentHash(String contentHash) Set value for optional field.withExportInfo(ExportInfo exportInfo) Set value for optional field.withFileLockInfo(FileLockMetadata fileLockInfo) Set value for optional field.withHasExplicitSharedMembers(Boolean hasExplicitSharedMembers) Set value for optional field.withIsDownloadable(Boolean isDownloadable) Set value for optional field.withIsRestorable(Boolean isRestorable) Set value for optional field.withMediaInfo(MediaInfo mediaInfo) Set value for optional field.withParentSharedFolderId(String parentSharedFolderId) Deprecated.withPathDisplay(String pathDisplay) Set value for optional field.withPathLower(String pathLower) Set value for optional field.withPreviewUrl(String previewUrl) Set value for optional field.withPropertyGroups(List<PropertyGroup> propertyGroups) Set value for optional field.withSharingInfo(FileSharingInfo sharingInfo) Set value for optional field.withSymlinkInfo(SymlinkInfo symlinkInfo) Set value for optional field.
-
Field Details
-
id
-
clientModified
-
serverModified
-
rev
-
size
protected final long size -
mediaInfo
-
symlinkInfo
-
sharingInfo
-
isDownloadable
protected boolean isDownloadable -
exportInfo
-
propertyGroups
-
contentHash
-
fileLockInfo
-
isRestorable
-
-
Constructor Details
-
Builder
-
-
Method Details
-
withMediaInfo
Set value for optional field.- Parameters:
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.- Returns:
- this builder
-
withSymlinkInfo
Set value for optional field.- Parameters:
symlinkInfo- Set if this file is a symlink.- Returns:
- this builder
-
withSharingInfo
Set value for optional field.- Parameters:
sharingInfo- Set if this file is contained in a shared folder.- Returns:
- this builder
-
withIsDownloadable
Set value for optional field.If left unset or set to
null, defaults totrue.- Parameters:
isDownloadable- If true, file can be downloaded directly; else the file must be exported. Defaults totruewhen set tonull.- Returns:
- this builder
-
withExportInfo
Set value for optional field.- Parameters:
exportInfo- Information about format this file can be exported to. This filed must be set ifFileMetadata.getIsDownloadable()is set to false.- Returns:
- this builder
-
withPropertyGroups
Set value for optional field.- Parameters:
propertyGroups- Additional information if the file has custom properties with the property template specified. Must not contain anullitem.- Returns:
- this builder
- Throws:
IllegalArgumentException- If any argument does not meet its preconditions.
-
withContentHash
Set value for optional field.- Parameters:
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.- Returns:
- this builder
- Throws:
IllegalArgumentException- If any argument does not meet its preconditions.
-
withFileLockInfo
Set value for optional field.- Parameters:
fileLockInfo- If present, the metadata associated with the file's current lock.- Returns:
- this builder
-
withIsRestorable
Set value for optional field.- Parameters:
isRestorable- If present, indicates whether this file revision can be restored.- Returns:
- this builder
-
withPathLower
Set value for optional field.- Overrides:
withPathLowerin classMetadata.Builder- Parameters:
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.- Returns:
- this builder
-
withPathDisplay
Set value for optional field.- Overrides:
withPathDisplayin classMetadata.Builder- Parameters:
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.- Returns:
- this builder
-
withPreviewUrl
Set value for optional field.- Overrides:
withPreviewUrlin classMetadata.Builder- Parameters:
previewUrl- The preview URL of the file.- Returns:
- this builder
-
build
Builds an instance ofFileMetadataconfigured with this builder's values- Overrides:
buildin classMetadata.Builder- Returns:
- new instance of
FileMetadata
-