@BoxResourceType(value="file_version") public class BoxFileVersion extends BoxResource
BoxResource.Info
Modifier and Type | Field and Description |
---|---|
static URLTemplate |
CONTENT_URL_TEMPLATE
Content URL Template.
|
static long |
DEFAULT_LIMIT
The default limit of entries per response.
|
static URLTemplate |
VERSION_URL_TEMPLATE
Version URL Template.
|
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.
|
Date |
getPurgedAt()
Gets the time that this version of the file was purged.
|
Date |
getRestoredAt()
Gets the time that this version of the file was restored.
|
BoxUser.Info |
getRestoredBy()
Gets information about the user who restored 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.
|
BoxUser.Info |
getTrashedBy()
Gets information about the user who trashed this version of the file.
|
String |
getUploaderDisplayName()
Gets the user's name at the time of upload.
|
String |
getVersionID()
Gets the version ID of this version of the file.
|
Long |
getVersionNumber()
Returns version number.
|
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 static final URLTemplate CONTENT_URL_TEMPLATE
public static final URLTemplate VERSION_URL_TEMPLATE
public static final long DEFAULT_LIMIT
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 String getUploaderDisplayName()
public Date getModifiedAt()
public Date getTrashedAt()
public BoxUser.Info getTrashedBy()
public BoxUser.Info getModifiedBy()
public Date getRestoredAt()
public BoxUser.Info getRestoredBy()
public Date getPurgedAt()
public Long getVersionNumber()
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()