@@ -52,6 +52,10 @@ public DownloadableContributionsDownloader(File _stagingFolder) {
5252 }
5353
5454 public File download (DownloadableContribution contribution , Progress progress , final String statusText , ProgressListener progressListener ) throws Exception {
55+ return download (contribution , progress , statusText , progressListener , false );
56+ }
57+
58+ public File download (DownloadableContribution contribution , Progress progress , final String statusText , ProgressListener progressListener , boolean noResume ) throws Exception {
5559 URL url = new URL (contribution .getUrl ());
5660 Path outputFile = Paths .get (stagingFolder .getAbsolutePath (), contribution .getArchiveFileName ());
5761
@@ -66,7 +70,7 @@ public File download(DownloadableContribution contribution, Progress progress, f
6670 while (true ) {
6771 // Need to download or resume downloading?
6872 if (!Files .isRegularFile (outputFile , LinkOption .NOFOLLOW_LINKS ) || (Files .size (outputFile ) < contribution .getSize ())) {
69- download (url , outputFile .toFile (), progress , statusText , progressListener );
73+ download (url , outputFile .toFile (), progress , statusText , progressListener , noResume );
7074 downloaded = true ;
7175 }
7276
@@ -113,6 +117,10 @@ private boolean hasChecksum(DownloadableContribution contribution) {
113117 }
114118
115119 public void download (URL url , File tmpFile , Progress progress , String statusText , ProgressListener progressListener ) throws Exception {
120+ download (url , tmpFile , progress , statusText , progressListener , false );
121+ }
122+
123+ public void download (URL url , File tmpFile , Progress progress , String statusText , ProgressListener progressListener , boolean noResume ) throws Exception {
116124 FileDownloader downloader = new FileDownloader (url , tmpFile );
117125 downloader .addObserver ((o , arg ) -> {
118126 FileDownloader me = (FileDownloader ) o ;
@@ -126,7 +134,7 @@ public void download(URL url, File tmpFile, Progress progress, String statusText
126134 progress .setProgress (me .getProgress ());
127135 progressListener .onProgress (progress );
128136 });
129- downloader .download ();
137+ downloader .download (noResume );
130138 if (!downloader .isCompleted ()) {
131139 throw new Exception (format (tr ("Error downloading {0}" ), url ), downloader .getError ());
132140 }
0 commit comments