Class DownloadStatus

java.lang.Object
org.alfresco.service.cmr.download.DownloadStatus
All Implemented Interfaces:
Serializable

public class DownloadStatus extends Object implements 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:
  • Constructor Details

    • DownloadStatus

      public DownloadStatus(DownloadStatus.Status status, long done, long total, long filesAdded, long totalFiles)
      Default constructor
      Parameters:
      status - Current status of the download
      done - Done count
      total - Total to be de done
      filesAdded - Number of files added to the archive
      totalFiles - 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

      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