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.Date
clientModified
protected java.lang.String
contentHash
protected ExportInfo
exportInfo
protected FileLockMetadata
fileLockInfo
protected java.lang.Boolean
hasExplicitSharedMembers
protected java.lang.String
id
protected boolean
isDownloadable
protected MediaInfo
mediaInfo
protected java.util.List<PropertyGroup>
propertyGroups
protected java.lang.String
rev
protected java.util.Date
serverModified
protected FileSharingInfo
sharingInfo
protected long
size
protected SymlinkInfo
symlinkInfo
-
Fields inherited from class com.dropbox.core.v2.files.Metadata.Builder
name, parentSharedFolderId, pathDisplay, pathLower, previewUrl
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Builder(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 FileMetadata
build()
Builds an instance ofFileMetadata
configured with this builder's valuesFileMetadata.Builder
withContentHash(java.lang.String contentHash)
Set value for optional field.FileMetadata.Builder
withExportInfo(ExportInfo exportInfo)
Set value for optional field.FileMetadata.Builder
withFileLockInfo(FileLockMetadata fileLockInfo)
Set value for optional field.FileMetadata.Builder
withHasExplicitSharedMembers(java.lang.Boolean hasExplicitSharedMembers)
Set value for optional field.FileMetadata.Builder
withIsDownloadable(java.lang.Boolean isDownloadable)
Set value for optional field.FileMetadata.Builder
withMediaInfo(MediaInfo mediaInfo)
Set value for optional field.FileMetadata.Builder
withParentSharedFolderId(java.lang.String parentSharedFolderId)
Set value for optional field.FileMetadata.Builder
withPathDisplay(java.lang.String pathDisplay)
Set value for optional field.FileMetadata.Builder
withPathLower(java.lang.String pathLower)
Set value for optional field.FileMetadata.Builder
withPreviewUrl(java.lang.String previewUrl)
Set value for optional field.FileMetadata.Builder
withPropertyGroups(java.util.List<PropertyGroup> propertyGroups)
Set value for optional field.FileMetadata.Builder
withSharingInfo(FileSharingInfo sharingInfo)
Set value for optional field.FileMetadata.Builder
withSymlinkInfo(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 totrue
when 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 anull
item.- 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:
withPathLower
in 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:
withPathDisplay
in 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:
withParentSharedFolderId
in 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:
withPreviewUrl
in classMetadata.Builder
- Parameters:
previewUrl
- The preview URL of the file.- Returns:
- this builder
-
build
public FileMetadata build()
Builds an instance ofFileMetadata
configured with this builder's values- Overrides:
build
in classMetadata.Builder
- Returns:
- new instance of
FileMetadata
-
-