Class B2FileVersion
- java.lang.Object
-
- com.backblaze.b2.client.structures.B2FileVersion
-
public class B2FileVersion extends java.lang.ObjectInformation 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.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringFOLDER_ACTIONstatic java.lang.StringHIDE_ACTIONstatic java.lang.StringSTART_ACTIONstatic java.lang.StringUPLOAD_ACTION
-
Constructor Summary
Constructors Constructor Description 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 Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)java.lang.StringgetAction()longgetContentLength()java.lang.StringgetContentMd5()java.lang.StringgetContentSha1()java.lang.StringgetContentType()java.lang.StringgetFileId()java.util.Map<java.lang.String,java.lang.String>getFileInfo()java.lang.StringgetFileName()B2FileRetentiongetFileRetention()Returns the file retention setting on the file versionjava.lang.StringgetLargeFileSha1OrNull()java.lang.StringgetLegalHold()Returns the legal hold status on the file versionjava.lang.StringgetReplicationStatus()B2FileSseForResponsegetServerSideEncryption()longgetUploadTimestamp()inthashCode()booleanisClientAuthorizedToReadFileRetention()Indicates whether or not the client is authorized to read the file retention from this file version.booleanisClientAuthorizedToReadLegalHold()Indicates whether or not the client is authorized to read the legal hold status from this file version.booleanisFolder()booleanisHide()booleanisStart()booleanisUpload()java.lang.StringtoString()
-
-
-
Field Detail
-
UPLOAD_ACTION
public static final java.lang.String UPLOAD_ACTION
- See Also:
- Constant Field Values
-
HIDE_ACTION
public static final java.lang.String HIDE_ACTION
- See Also:
- Constant Field Values
-
START_ACTION
public static final java.lang.String START_ACTION
- See Also:
- Constant Field Values
-
FOLDER_ACTION
public static final java.lang.String FOLDER_ACTION
- See Also:
- Constant Field Values
-
-
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 B2ForbiddenExceptionReturns 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
-
getServerSideEncryption
public B2FileSseForResponse getServerSideEncryption()
-
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:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-