mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 17:11:39 +03:00
[FIX] Исправление ошибки при перезаписе файла
This commit is contained in:
parent
227d0db778
commit
7f6a83fb66
1 changed files with 5 additions and 0 deletions
|
@ -13,6 +13,7 @@
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
|
@ -82,6 +83,10 @@ public void postDiff(UpdateRequest request, UpdateRequestEvent e, HashedDir.Diff
|
||||||
LogHelper.debug("Copy file %s to %s", ret.toAbsolutePath().toString(), source.toAbsolutePath().toString());
|
LogHelper.debug("Copy file %s to %s", ret.toAbsolutePath().toString(), source.toAbsolutePath().toString());
|
||||||
//Let's go!
|
//Let's go!
|
||||||
Files.copy(ret, source);
|
Files.copy(ret, source);
|
||||||
|
try(InputStream input = IOHelper.newInput(ret))
|
||||||
|
{
|
||||||
|
IOHelper.transfer(input, source);
|
||||||
|
}
|
||||||
removed.add(path.replace('\\', '/'));
|
removed.add(path.replace('\\', '/'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue