@@ -147,7 +147,7 @@ private void downloadFile(boolean noResume) throws InterruptedException {
147
147
148
148
final Optional <FileDownloaderCache .FileCached > fileCached = FileDownloaderCache .getFileCached (downloadUrl );
149
149
150
- if (fileCached .isPresent () && ! fileCached .get ().isChange ()) {
150
+ if (fileCached .isPresent () && fileCached .get ().isNotChange ()) {
151
151
try {
152
152
final Optional <File > fileFromCache =
153
153
fileCached .get ().getFileFromCache ();
@@ -156,11 +156,17 @@ private void downloadFile(boolean noResume) throws InterruptedException {
156
156
FileUtils .copyFile (fileFromCache .get (), outputFile );
157
157
setStatus (Status .COMPLETE );
158
158
return ;
159
+ } else {
160
+ log .info (
161
+ "The file in the cache is not in the path or the md5 validation failed: path={}, file exist={}, md5 validation={}" ,
162
+ fileCached .get ().getLocalPath (), fileCached .get ().exists (), fileCached .get ().md5Check ());
159
163
}
160
164
} catch (Exception e ) {
161
165
log .warn (
162
- "Cannot get the file from the cache, will be downloaded a new one " , e . getCause () );
166
+ "Cannot get the file from the cache, will be downloaded a new one " , e );
163
167
}
168
+ } else {
169
+ log .info ("The file is change {}" , fileCached );
164
170
}
165
171
166
172
initialSize = outputFile .length ();
@@ -226,10 +232,12 @@ private void downloadFile(boolean noResume) throws InterruptedException {
226
232
} catch (SocketTimeoutException e ) {
227
233
setStatus (Status .CONNECTION_TIMEOUT_ERROR );
228
234
setError (e );
235
+ log .error (e );
229
236
230
237
} catch (Exception e ) {
231
238
setStatus (Status .ERROR );
232
239
setError (e );
240
+ log .error (e );
233
241
234
242
} finally {
235
243
IOUtils .closeQuietly (randomAccessOutputFile );
0 commit comments