Class DownloadStatus
- java.lang.Object
-
- org.alfresco.service.cmr.download.DownloadStatus
-
- All Implemented Interfaces:
java.io.Serializable
public class DownloadStatus extends java.lang.Object implements java.io.SerializableImmutable 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:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDownloadStatus.Status
-
Constructor Summary
Constructors Constructor Description DownloadStatus(DownloadStatus.Status status, long done, long total, long filesAdded, long totalFiles)Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetDone()longgetFilesAdded()longgetPercentageComplete()DownloadStatus.StatusgetStatus()longgetTotal()longgetTotalFiles()booleanisComplete()
-
-
-
Constructor Detail
-
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 Detail
-
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
public DownloadStatus.Status 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
-
-