[FIX] Создание директорий UpdateRequest'ом

This commit is contained in:
Gravit 2019-04-27 20:55:29 +07:00
parent 24a453f338
commit b3079b83dc
No known key found for this signature in database
GPG key ID: 061981E1E85D3216

View file

@ -174,11 +174,19 @@ public UpdateRequestEvent requestDo() throws Exception {
HashedDir.Diff diff = e.hdir.diff(localDir, matcher);
final List<ListDownloader.DownloadTask> adds = new ArrayList<>();
diff.mismatch.walk(IOHelper.CROSS_SEPARATOR, (path, name, entry) -> {
if(entry.getType() == HashedEntry.Type.FILE) {
if(entry.getType().equals(HashedEntry.Type.FILE)) {
HashedFile file = (HashedFile) entry;
totalSize += file.size;
adds.add(new ListDownloader.DownloadTask(path, file.size));
}
else if(entry.getType().equals(HashedEntry.Type.DIR))
{
try {
Files.createDirectories(dir.resolve(path));
} catch (IOException ex) {
LogHelper.error(ex);
}
}
});
totalSize = diff.mismatch.size();
startTime = Instant.now();