[FIX] Исправление FileAlreadyExistsException

This commit is contained in:
Gravit 2019-09-18 02:04:39 +07:00
parent b01e52bb17
commit 06c33a47ad
No known key found for this signature in database
GPG key ID: 061981E1E85D3216

View file

@ -76,6 +76,7 @@ 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.deleteIfExists(source);
Files.copy(ret, source); Files.copy(ret, source);
try (InputStream input = IOHelper.newInput(ret)) { try (InputStream input = IOHelper.newInput(ret)) {
IOHelper.transfer(input, source); IOHelper.transfer(input, source);