Skip to content

Commit

Permalink
Fix FileSystemException on reload
Browse files Browse the repository at this point in the history
  • Loading branch information
NichtStudioCode committed Nov 11, 2022
1 parent 76440ed commit a3b39d1
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
import xyz.xenondevs.nova.loader.library.NovaLibraryLoader;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;
import java.util.Arrays;
import java.util.logging.Level;
import java.util.logging.Logger;
Expand Down Expand Up @@ -55,7 +54,9 @@ public static File extractNovaJar(NovaLoader loader, String pathInJar) throws IO

try (var in = NovaLoader.class.getResourceAsStream(pathInJar)) {
assert in != null;
Files.copy(in, file.toPath(), StandardCopyOption.REPLACE_EXISTING);
try (var out = new FileOutputStream(file)) {
in.transferTo(out);
}
}

return file;
Expand Down

0 comments on commit a3b39d1

Please sign in to comment.