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 for FileMetadata.
  • Field Details

    • id

      protected final String id
    • clientModified

      protected final Date clientModified
    • serverModified

      protected final Date serverModified
    • rev

      protected final 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 List<PropertyGroup> propertyGroups
    • hasExplicitSharedMembers

      protected Boolean hasExplicitSharedMembers
    • contentHash

      protected String contentHash
    • fileLockInfo

      protected FileLockMetadata fileLockInfo
    • isRestorable

      protected Boolean isRestorable
  • Constructor Details

  • Method Details

    • 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 by DbxAppFilesRequests.listFolder(String), DbxAppFilesRequests.listFolderContinue(String), or DbxUserFilesRequests.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(Boolean isDownloadable)
      Set value for optional field.

      If left unset or set to null, defaults to true.

      Parameters:
      isDownloadable - If true, file can be downloaded directly; else the file must be exported. Defaults to true when set to null.
      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 if FileMetadata.getIsDownloadable() is set to false.
      Returns:
      this builder
    • withPropertyGroups

      public FileMetadata.Builder withPropertyGroups(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 a null item.
      Returns:
      this builder
      Throws:
      IllegalArgumentException - If any argument does not meet its preconditions.
    • withHasExplicitSharedMembers

      public FileMetadata.Builder withHasExplicitSharedMembers(Boolean hasExplicitSharedMembers)
      Set value for optional field.
      Parameters:
      hasExplicitSharedMembers - This flag will only be present if include_has_explicit_shared_members is true in DbxAppFilesRequests.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.
      Returns:
      this builder
    • withContentHash

      public FileMetadata.Builder withContentHash(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:
      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
    • withIsRestorable

      public FileMetadata.Builder withIsRestorable(Boolean isRestorable)
      Set value for optional field.
      Parameters:
      isRestorable - If present, indicates whether this file revision can be restored.
      Returns:
      this builder
    • withPathLower

      public FileMetadata.Builder withPathLower(String pathLower)
      Set value for optional field.
      Overrides:
      withPathLower in class Metadata.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(String pathDisplay)
      Set value for optional field.
      Overrides:
      withPathDisplay in class Metadata.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 by DbxAppFilesRequests.listFolderContinue(String). This field will be null if the file or folder is not mounted.
      Returns:
      this builder
    • withParentSharedFolderId

      @Deprecated public FileMetadata.Builder withParentSharedFolderId(String parentSharedFolderId)
      Deprecated.
      Set value for optional field.
      Overrides:
      withParentSharedFolderId in class Metadata.Builder
      Parameters:
      parentSharedFolderId - Field is deprecated. Please use FileSharingInfo.getParentSharedFolderId() or FolderSharingInfo.getParentSharedFolderId() instead. Must match pattern "[-_0-9a-zA-Z:]+".
      Returns:
      this builder
      Throws:
      IllegalArgumentException - If any argument does not meet its preconditions.
    • withPreviewUrl

      public FileMetadata.Builder withPreviewUrl(String previewUrl)
      Set value for optional field.
      Overrides:
      withPreviewUrl in class Metadata.Builder
      Parameters:
      previewUrl - The preview URL of the file.
      Returns:
      this builder
    • build

      public FileMetadata build()
      Builds an instance of FileMetadata configured with this builder's values
      Overrides:
      build in class Metadata.Builder
      Returns:
      new instance of FileMetadata