mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2024-11-29 05:55:57 +01:00
Tentative fix trying to move a non-existing filepart file
This commit is contained in:
parent
8eb74004c6
commit
1d11206d13
@ -24,6 +24,8 @@
|
|||||||
*/
|
*/
|
||||||
package de.bluecolored.bluemap.core.util;
|
package de.bluecolored.bluemap.core.util;
|
||||||
|
|
||||||
|
import de.bluecolored.bluemap.core.logger.Logger;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.nio.file.*;
|
import java.nio.file.*;
|
||||||
|
|
||||||
@ -39,6 +41,8 @@ public static OutputStream createFilepartOutputStream(final Path file) throws IO
|
|||||||
|
|
||||||
OutputStream os = Files.newOutputStream(partFile, StandardOpenOption.WRITE, StandardOpenOption.TRUNCATE_EXISTING, StandardOpenOption.CREATE);
|
OutputStream os = Files.newOutputStream(partFile, StandardOpenOption.WRITE, StandardOpenOption.TRUNCATE_EXISTING, StandardOpenOption.CREATE);
|
||||||
return new WrappedOutputStream(os, () -> {
|
return new WrappedOutputStream(os, () -> {
|
||||||
|
if (!Files.exists(partFile)) return;
|
||||||
|
|
||||||
Files.deleteIfExists(file);
|
Files.deleteIfExists(file);
|
||||||
Files.createDirectories(file.getParent());
|
Files.createDirectories(file.getParent());
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user