/** * @return * an estimate of the how many <b>seconds</b> until the data transfer completes, based on the * overall byte rate of the transmission. * @throws IllegalStateException * if the time remaining estimave is not available - check this availability * with the {@link #isTimeRemainingAvailable()} method. */ public long getTimeRemaining() { if (!isTimeRemainingAvailable()) { throw new IllegalStateException("Time remaining estimate is not available in this object"); } return BytesProgressWatcher.calculateRemainingTime(progressWatchers); }
/** * @return * an estimate of the how many <b>seconds</b> until the data transfer completes, based on the * overall byte rate of the transmission. * @throws IllegalStateException * if the time remaining estimave is not available - check this availability * with the {@link #isTimeRemainingAvailable()} method. */ public long getTimeRemaining() { if (!isTimeRemainingAvailable()) { throw new IllegalStateException("Time remaining estimate is not available in this object"); } return BytesProgressWatcher.calculateRemainingTime(progressWatchers); }
private String formatTransferDetails(ThreadWatcher watcher) { String detailsText = ""; long bytesPerSecond = watcher.getBytesPerSecond(); detailsText = byteFormatter.formatByteSize(bytesPerSecond) + "/s"; if (watcher.isTimeRemainingAvailable()) { if (detailsText.trim().length() > 0) { detailsText += " - "; } long secondsRemaining = watcher.getTimeRemaining(); detailsText += "ETA: " + timeFormatter.formatTime(secondsRemaining, false); } return detailsText; }
private String formatTransferDetails(ThreadWatcher watcher) { String detailsText = ""; long bytesPerSecond = watcher.getBytesPerSecond(); detailsText = byteFormatter.formatByteSize(bytesPerSecond) + "/s"; if (watcher.isTimeRemainingAvailable()) { if (detailsText.trim().length() > 0) { detailsText += " - "; } long secondsRemaining = watcher.getTimeRemaining(); detailsText += "ETA: " + timeFormatter.formatTime(secondsRemaining, false); } return detailsText; }