@BoxResourceType(value="file_version") public class BoxFileVersion extends BoxResource
BoxResource.Info
Constructor and Description |
---|
BoxFileVersion(BoxAPIConnection api,
String json,
String fileID)
Constructs a BoxFileVersion from a JSON string.
|
Modifier and Type | Method and Description |
---|---|
void |
delete()
Deletes this version of the file.
|
void |
download(OutputStream output)
Downloads this version of the file to a given OutputStream.
|
void |
download(OutputStream output,
ProgressListener listener)
Downloads this version of the file to a given OutputStream while reporting the progress to a ProgressListener.
|
Date |
getCreatedAt()
Gets the time that this version of the file was created.
|
String |
getFileID() |
Date |
getModifiedAt()
Gets the time that this version of the file was modified.
|
BoxUser.Info |
getModifiedBy()
Gets information about the user who last modified this version of the file.
|
String |
getName()
Gets the name of this version of the file.
|
String |
getSha1()
Gets the SHA1 hash of this version of the file.
|
long |
getSize()
Gets the size of this version of the file.
|
Date |
getTrashedAt()
Gets the time that this version of the file was deleted.
|
String |
getVersionID()
Gets the version ID of this version of the file.
|
void |
promote()
Promotes this version of the file to be the latest version.
|
void |
setFileID(String fileID)
Used if no or wrong file id was set with constructor.
|
equals, getAPI, getID, getResourceType, hashCode
public BoxFileVersion(BoxAPIConnection api, String json, String fileID)
api
- the API connection to be used by the file.json
- the JSON encoded file version.fileID
- the ID of the file.public void setFileID(String fileID)
fileID
- the file id this file version belongs to.public String getVersionID()
public String getSha1()
public String getName()
public long getSize()
public Date getCreatedAt()
public Date getModifiedAt()
public Date getTrashedAt()
public BoxUser.Info getModifiedBy()
public void delete()
public void download(OutputStream output)
output
- the stream to where the file will be written.public void download(OutputStream output, ProgressListener listener)
output
- the stream to where the file will be written.listener
- a listener for monitoring the download's progress.public void promote()