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
public static class FileMetadata.Builder extends Metadata.Builder
Builder forFileMetadata.
-
-
Field Summary
Fields 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.Metadata.Builder
name, parentSharedFolderId, pathDisplay, pathLower, previewUrl
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBuilder(java.lang.String name, java.lang.String id, java.util.Date clientModified, java.util.Date serverModified, java.lang.String rev, long size)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FileMetadatabuild()Builds an instance ofFileMetadataconfigured with this builder's valuesFileMetadata.BuilderwithContentHash(java.lang.String contentHash)Set value for optional field.FileMetadata.BuilderwithExportInfo(ExportInfo exportInfo)Set value for optional field.FileMetadata.BuilderwithFileLockInfo(FileLockMetadata fileLockInfo)Set value for optional field.FileMetadata.BuilderwithHasExplicitSharedMembers(java.lang.Boolean hasExplicitSharedMembers)Set value for optional field.FileMetadata.BuilderwithIsDownloadable(java.lang.Boolean isDownloadable)Set value for optional field.FileMetadata.BuilderwithMediaInfo(MediaInfo mediaInfo)Set value for optional field.FileMetadata.BuilderwithParentSharedFolderId(java.lang.String parentSharedFolderId)Set value for optional field.FileMetadata.BuilderwithPathDisplay(java.lang.String pathDisplay)Set value for optional field.FileMetadata.BuilderwithPathLower(java.lang.String pathLower)Set value for optional field.FileMetadata.BuilderwithPreviewUrl(java.lang.String previewUrl)Set value for optional field.FileMetadata.BuilderwithPropertyGroups(java.util.List<PropertyGroup> propertyGroups)Set value for optional field.FileMetadata.BuilderwithSharingInfo(FileSharingInfo sharingInfo)Set value for optional field.FileMetadata.BuilderwithSymlinkInfo(SymlinkInfo symlinkInfo)Set value for optional field.
-
-
-
Field Detail
-
id
protected final java.lang.String id
-
clientModified
protected final java.util.Date clientModified
-
serverModified
protected final java.util.Date serverModified
-
rev
protected final java.lang.String rev
-
size
protected final long size
-
mediaInfo
protected MediaInfo mediaInfo
-
symlinkInfo
protected SymlinkInfo symlinkInfo
-
sharingInfo
protected FileSharingInfo sharingInfo
-
isDownloadable
protected boolean isDownloadable
-
exportInfo
protected ExportInfo exportInfo
-
propertyGroups
protected java.util.List<PropertyGroup> propertyGroups
-
hasExplicitSharedMembers
protected java.lang.Boolean hasExplicitSharedMembers
-
contentHash
protected java.lang.String contentHash
-
fileLockInfo
protected FileLockMetadata fileLockInfo
-
-
Method Detail
-
withMediaInfo
public FileMetadata.Builder withMediaInfo(MediaInfo mediaInfo)
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
public FileMetadata.Builder withSymlinkInfo(SymlinkInfo symlinkInfo)
Set value for optional field.- Parameters:
symlinkInfo- Set if this file is a symlink.- Returns:
- this builder
-
withSharingInfo
public FileMetadata.Builder withSharingInfo(FileSharingInfo sharingInfo)
Set value for optional field.- Parameters:
sharingInfo- Set if this file is contained in a shared folder.- Returns:
- this builder
-
withIsDownloadable
public FileMetadata.Builder withIsDownloadable(java.lang.Boolean isDownloadable)
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
public FileMetadata.Builder withExportInfo(ExportInfo exportInfo)
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
public FileMetadata.Builder withPropertyGroups(java.util.List<PropertyGroup> propertyGroups)
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:
java.lang.IllegalArgumentException- If any argument does not meet its preconditions.
-
withHasExplicitSharedMembers
public FileMetadata.Builder withHasExplicitSharedMembers(java.lang.Boolean hasExplicitSharedMembers)
Set value for optional field.- Parameters:
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.- Returns:
- this builder
-
withContentHash
public FileMetadata.Builder withContentHash(java.lang.String contentHash)
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:
java.lang.IllegalArgumentException- If any argument does not meet its preconditions.
-
withFileLockInfo
public FileMetadata.Builder withFileLockInfo(FileLockMetadata fileLockInfo)
Set value for optional field.- Parameters:
fileLockInfo- If present, the metadata associated with the file's current lock.- Returns:
- this builder
-
withPathLower
public FileMetadata.Builder withPathLower(java.lang.String pathLower)
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
public FileMetadata.Builder withPathDisplay(java.lang.String pathDisplay)
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
-
withParentSharedFolderId
public FileMetadata.Builder withParentSharedFolderId(java.lang.String parentSharedFolderId)
Set value for optional field.- Overrides:
withParentSharedFolderIdin classMetadata.Builder- Parameters:
parentSharedFolderId- Please useFileSharingInfo.getParentSharedFolderId()orFolderSharingInfo.getParentSharedFolderId()instead. Must match pattern "[-_0-9a-zA-Z:]+".- Returns:
- this builder
- Throws:
java.lang.IllegalArgumentException- If any argument does not meet its preconditions.
-
withPreviewUrl
public FileMetadata.Builder withPreviewUrl(java.lang.String previewUrl)
Set value for optional field.- Overrides:
withPreviewUrlin classMetadata.Builder- Parameters:
previewUrl- The preview URL of the file.- Returns:
- this builder
-
build
public FileMetadata build()
Builds an instance ofFileMetadataconfigured with this builder's values- Overrides:
buildin classMetadata.Builder- Returns:
- new instance of
FileMetadata
-
-