mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2025-01-24 01:01:50 +01:00
Dont delete the file since we are replacing it anyways, to minimize the risk of deleting the file without a replacement
This commit is contained in:
parent
9de49dc313
commit
4386e35c59
@ -39,14 +39,10 @@ public class FileHelper {
|
||||
public static OutputStream createFilepartOutputStream(final Path file) throws IOException {
|
||||
final Path partFile = getPartFile(file);
|
||||
FileHelper.createDirectories(partFile.getParent());
|
||||
|
||||
OutputStream os = Files.newOutputStream(partFile, StandardOpenOption.WRITE, StandardOpenOption.TRUNCATE_EXISTING, StandardOpenOption.CREATE);
|
||||
return new WrappedOutputStream(os, () -> {
|
||||
if (!Files.exists(partFile)) return;
|
||||
|
||||
Files.deleteIfExists(file);
|
||||
FileHelper.createDirectories(file.getParent());
|
||||
|
||||
FileHelper.move(partFile, file);
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user