Class DownloadStatus

  • All Implemented Interfaces:
    java.io.Serializable

    public class DownloadStatus
    extends java.lang.Object
    implements java.io.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:
    Serialized Form
    • Constructor Detail

      • 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 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.
      • 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