Check for cachedFiles existing

This commit is contained in:
comp500 2019-07-04 01:08:24 +01:00
parent a5ff63c587
commit 794b817eff
No known key found for this signature in database
GPG Key ID: 214C822FFEC586B5

View File

@ -149,14 +149,16 @@ public class UpdateManager {
ui.submitProgress(new InstallProgress("Checking local files..."));
List<URI> invalidatedUris = new ArrayList<>();
Iterator<Map.Entry<URI, ManifestFile.File>> it = manifest.cachedFiles.entrySet().iterator();
while (it.hasNext()) {
Map.Entry<URI, ManifestFile.File> entry = it.next();
if (entry.getValue().cachedLocation != null) {
if (!Files.exists(Paths.get(opts.packFolder, entry.getValue().cachedLocation))) {
URI fileUri = entry.getKey();
System.out.println("File " + fileUri.toString() + " invalidated, marked for redownloading");
invalidatedUris.add(fileUri);
if (manifest.cachedFiles != null) {
Iterator<Map.Entry<URI, ManifestFile.File>> it = manifest.cachedFiles.entrySet().iterator();
while (it.hasNext()) {
Map.Entry<URI, ManifestFile.File> entry = it.next();
if (entry.getValue().cachedLocation != null) {
if (!Files.exists(Paths.get(opts.packFolder, entry.getValue().cachedLocation))) {
URI fileUri = entry.getKey();
System.out.println("File " + fileUri.toString() + " invalidated, marked for redownloading");
invalidatedUris.add(fileUri);
}
}
}
}