use of org.jabref.logic.net.ProgressInputStream in project jabref by JabRef.
the class FileDownloadTask method call.
@Override
protected Void call() throws Exception {
URLDownload download = new URLDownload(source);
try (ProgressInputStream inputStream = download.asInputStream()) {
EasyBind.subscribe(inputStream.totalNumBytesReadProperty(), bytesRead -> updateProgress(bytesRead.longValue(), inputStream.getMaxNumBytes()));
Files.copy(inputStream, destination, StandardCopyOption.REPLACE_EXISTING);
}
return null;
}
Aggregations