Class DownloadStatus
java.lang.Object
org.alfresco.service.cmr.download.DownloadStatus
- All Implemented Interfaces:
Serializable
Immutable data transfer object representing the status of a download.
Provides the current status and an indication of the progress. Prgress is
measured by comparing done against total. Total gives an indication of the
total work, while done indicates how much has been completed.
- Author:
- amiller
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionDownloadStatus(DownloadStatus.Status status, long done, long total, long filesAdded, long totalFiles) Default constructor -
Method Summary
-
Constructor Details
-
DownloadStatus
public DownloadStatus(DownloadStatus.Status status, long done, long total, long filesAdded, long totalFiles) Default constructor- Parameters:
status- Current status of the downloaddone- Done counttotal- Total to be de donefilesAdded- Number of files added to the archivetotalFiles- The number of files that will eventually be added to the archive
-
-
Method Details
-
getPercentageComplete
public long getPercentageComplete()- Returns:
- The percentage complete, calculated by multiplying done by 100 and dividing by total.
-
isComplete
public boolean isComplete()- Returns:
- true if status is DONE, false otherwise.
-
getStatus
- Returns:
- the current status
-
getDone
public long getDone()- Returns:
- the current done count
-
getTotal
public long getTotal()- Returns:
- the total, to be done.
-
getTotalFiles
public long getTotalFiles()- Returns:
- the total number of files in the download archive
-
getFilesAdded
public long getFilesAdded()- Returns:
- the number of files added to the download archive
-