Class B2FileVersion


  • public class B2FileVersion
    extends java.lang.Object
    Information about a file, as returned by the B2 API. The API returns two fields that are not included here: accountId and bucketId. The reason for not including them is that this SDK also returns the same structure from getFileInfoByName, which gets the info from the headers returned by a HEAD request on the file, which do not include them.
    • Constructor Detail

      • B2FileVersion

        public B2FileVersion​(java.lang.String fileId,
                             java.lang.String fileName,
                             long contentLength,
                             java.lang.String contentType,
                             java.lang.String contentSha1,
                             java.lang.String contentMd5,
                             java.util.Map<java.lang.String,​java.lang.String> fileInfo,
                             java.lang.String action,
                             long uploadTimestamp,
                             B2AuthorizationFilteredResponseField<B2FileRetention> fileRetention,
                             B2AuthorizationFilteredResponseField<java.lang.String> legalHold,
                             B2FileSseForResponse serverSideEncryption,
                             java.lang.String replicationStatus)
    • Method Detail

      • getFileId

        public java.lang.String getFileId()
      • getFileName

        public java.lang.String getFileName()
      • getContentLength

        public long getContentLength()
      • getContentType

        public java.lang.String getContentType()
      • getContentSha1

        public java.lang.String getContentSha1()
      • getContentMd5

        public java.lang.String getContentMd5()
      • getLargeFileSha1OrNull

        public java.lang.String getLargeFileSha1OrNull()
      • getFileInfo

        public java.util.Map<java.lang.String,​java.lang.String> getFileInfo()
      • getAction

        public java.lang.String getAction()
      • getUploadTimestamp

        public long getUploadTimestamp()
      • isClientAuthorizedToReadFileRetention

        public boolean isClientAuthorizedToReadFileRetention()
        Indicates whether or not the client is authorized to read the file retention from this file version. If fileRetention field is null (e.g., for hidden files and folders), then this method returns true.
        Returns:
        true iff the client is authorized to read value of the file retention
      • getFileRetention

        public B2FileRetention getFileRetention()
                                         throws B2ForbiddenException
        Returns the file retention setting on the file version
        Returns:
        the file retention settings of the file version
        Throws:
        B2ForbiddenException - if the client is not authorized to read the file retention setting
      • isClientAuthorizedToReadLegalHold

        public boolean isClientAuthorizedToReadLegalHold()
        Indicates whether or not the client is authorized to read the legal hold status from this file version. If legalHold field is null (e.g., for hidden files and folders), then this method returns true.
        Returns:
        true iff the client is authorized to read value of the legal hold status
      • getLegalHold

        public java.lang.String getLegalHold()
                                      throws B2ForbiddenException
        Returns the legal hold status on the file version
        Returns:
        the legal hold status of the file version
        Throws:
        B2ForbiddenException - if the client is not authorized to read the legal hold status
      • getReplicationStatus

        public java.lang.String getReplicationStatus()
      • isUpload

        public boolean isUpload()
      • isHide

        public boolean isHide()
      • isStart

        public boolean isStart()
      • isFolder

        public boolean isFolder()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object