@@ -56,11 +56,11 @@ public DownloadableContributionsDownloader(File _stagingFolder) {
56
56
stagingFolder = _stagingFolder ;
57
57
}
58
58
59
- public File download (DownloadableContribution contribution , Progress progress , final String statusText , ProgressListener progressListener ) throws Exception {
60
- return download (contribution , progress , statusText , progressListener , false );
59
+ public File download (DownloadableContribution contribution , Progress progress , final String statusText , ProgressListener progressListener , boolean allowCache ) throws Exception {
60
+ return download (contribution , progress , statusText , progressListener , false , allowCache );
61
61
}
62
62
63
- public File download (DownloadableContribution contribution , Progress progress , final String statusText , ProgressListener progressListener , boolean noResume ) throws Exception {
63
+ public File download (DownloadableContribution contribution , Progress progress , final String statusText , ProgressListener progressListener , boolean noResume , boolean allowCache ) throws Exception {
64
64
URL url = new URL (contribution .getUrl ());
65
65
Path outputFile = Paths .get (stagingFolder .getAbsolutePath (), contribution .getArchiveFileName ());
66
66
@@ -75,7 +75,7 @@ public File download(DownloadableContribution contribution, Progress progress, f
75
75
while (true ) {
76
76
// Need to download or resume downloading?
77
77
if (!Files .isRegularFile (outputFile , LinkOption .NOFOLLOW_LINKS ) || (Files .size (outputFile ) < contribution .getSize ())) {
78
- download (url , outputFile .toFile (), progress , statusText , progressListener , noResume );
78
+ download (url , outputFile .toFile (), progress , statusText , progressListener , noResume , allowCache );
79
79
downloaded = true ;
80
80
}
81
81
@@ -121,11 +121,11 @@ private boolean hasChecksum(DownloadableContribution contribution) {
121
121
return algo != null && !algo .isEmpty ();
122
122
}
123
123
124
- public void download (URL url , File tmpFile , Progress progress , String statusText , ProgressListener progressListener ) throws Exception {
125
- download (url , tmpFile , progress , statusText , progressListener , false );
124
+ public void download (URL url , File tmpFile , Progress progress , String statusText , ProgressListener progressListener , boolean allowCache ) throws Exception {
125
+ download (url , tmpFile , progress , statusText , progressListener , false , allowCache );
126
126
}
127
127
128
- public void download (URL url , File tmpFile , Progress progress , String statusText , ProgressListener progressListener , boolean noResume ) throws Exception {
128
+ public void download (URL url , File tmpFile , Progress progress , String statusText , ProgressListener progressListener , boolean noResume , boolean allowCache ) throws Exception {
129
129
FileDownloader downloader = new FileDownloader (url , tmpFile );
130
130
downloader .addObserver ((o , arg ) -> {
131
131
FileDownloader me = (FileDownloader ) o ;
@@ -139,7 +139,7 @@ public void download(URL url, File tmpFile, Progress progress, String statusText
139
139
progress .setProgress (me .getProgress ());
140
140
progressListener .onProgress (progress );
141
141
});
142
- downloader .download (noResume );
142
+ downloader .download (noResume , allowCache );
143
143
if (!downloader .isCompleted ()) {
144
144
throw new Exception (format (tr ("Error downloading {0}" ), url ), downloader .getError ());
145
145
}
@@ -157,7 +157,7 @@ public void downloadIndexAndSignature(MultiStepProgress progress, URL packageInd
157
157
File packageIndexTemp = File .createTempFile (indexFileName , ".tmp" );
158
158
try {
159
159
// Download package index
160
- download (packageIndexUrl , packageIndexTemp , progress , statusText , progressListener , true );
160
+ download (packageIndexUrl , packageIndexTemp , progress , statusText , progressListener , true , true );
161
161
162
162
if (verifyDomain (packageIndexUrl )) {
163
163
URL signatureUrl = new URL (packageIndexUrl .toString () + ".sig" );
0 commit comments