Class B2FileVersion
- java.lang.Object
-
- com.backblaze.b2.client.structures.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.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
FOLDER_ACTION
static java.lang.String
HIDE_ACTION
static java.lang.String
START_ACTION
static java.lang.String
UPLOAD_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 boolean
equals(java.lang.Object o)
java.lang.String
getAction()
long
getContentLength()
java.lang.String
getContentMd5()
java.lang.String
getContentSha1()
java.lang.String
getContentType()
java.lang.String
getFileId()
java.util.Map<java.lang.String,java.lang.String>
getFileInfo()
java.lang.String
getFileName()
B2FileRetention
getFileRetention()
Returns the file retention setting on the file versionjava.lang.String
getLargeFileSha1OrNull()
java.lang.String
getLegalHold()
Returns the legal hold status on the file versionjava.lang.String
getReplicationStatus()
B2FileSseForResponse
getServerSideEncryption()
long
getUploadTimestamp()
int
hashCode()
boolean
isClientAuthorizedToReadFileRetention()
Indicates whether or not the client is authorized to read the file retention from this file version.boolean
isClientAuthorizedToReadLegalHold()
Indicates whether or not the client is authorized to read the legal hold status from this file version.boolean
isFolder()
boolean
isHide()
boolean
isStart()
boolean
isUpload()
java.lang.String
toString()
-
-
-
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 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
-
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:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-