mirror of
https://github.com/GravitLauncher/Launcher
synced 2025-04-19 14:33:04 +03:00
[FEATURE] Логгирование изменений в HashedDir.
This commit is contained in:
parent
6db6e4c31e
commit
f4105432ff
1 changed files with 16 additions and 2 deletions
|
@ -969,7 +969,22 @@ public void syncUpdatesDir(Collection<String> dirs) throws IOException {
|
||||||
LogHelper.info("Syncing '%s' update dir", name);
|
LogHelper.info("Syncing '%s' update dir", name);
|
||||||
HashedDir updateHDir = new HashedDir(updateDir, null, true, true);
|
HashedDir updateHDir = new HashedDir(updateDir, null, true, true);
|
||||||
if (work && config.zipDownload) processUpdate(updateDir, updateHDir, name);
|
if (work && config.zipDownload) processUpdate(updateDir, updateHDir, name);
|
||||||
newUpdatesDirMap.put(name, updateHDir);
|
HashedDir old = newUpdatesDirMap.put(name, updateHDir);
|
||||||
|
if (old != null) {
|
||||||
|
HashedDir.Diff diff = old.diff(updateHDir, null);
|
||||||
|
diff.extra.walk(IOHelper.CROSS_SEPARATOR, (String path, String namef, HashedEntry entry) -> {
|
||||||
|
if (entry.getType().equals(HashedEntry.Type.FILE)) {
|
||||||
|
LogHelper.info("Modified/added: " + path);
|
||||||
|
}
|
||||||
|
return HashedDir.WalkAction.CONTINUE;
|
||||||
|
});
|
||||||
|
diff.mismatch.walk(IOHelper.CROSS_SEPARATOR, (String path, String namef, HashedEntry entry) -> {
|
||||||
|
if (entry.getType().equals(HashedEntry.Type.FILE)) {
|
||||||
|
LogHelper.info("Removed: " + path);
|
||||||
|
}
|
||||||
|
return HashedDir.WalkAction.CONTINUE;
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
updatesDirMap = Collections.unmodifiableMap(newUpdatesDirMap);
|
updatesDirMap = Collections.unmodifiableMap(newUpdatesDirMap);
|
||||||
|
@ -999,7 +1014,6 @@ public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IO
|
||||||
}
|
}
|
||||||
return HashedDir.WalkAction.CONTINUE;
|
return HashedDir.WalkAction.CONTINUE;
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void restart() {
|
public void restart() {
|
||||||
|
|
Loading…
Reference in a new issue