diff --git a/src/main/java/lemon/hxdd/builder/PackageBuilder.java b/src/main/java/lemon/hxdd/builder/PackageBuilder.java index bcd0dc3..35ab42a 100644 --- a/src/main/java/lemon/hxdd/builder/PackageBuilder.java +++ b/src/main/java/lemon/hxdd/builder/PackageBuilder.java @@ -552,15 +552,13 @@ private void DownloadArtwork(int id, String name, String source, String filter) InputStream in = dl.openStream(); Files.copy(in, Path.of(steamPNG.getAbsolutePath()), StandardCopyOption.REPLACE_EXISTING); in.close(); - - Files.copy(steamPNG.toPath(), titlePNG.toPath(), StandardCopyOption.REPLACE_EXISTING); } File dirFile = new File(titlePNG.getParent()); if (!dirFile.exists()) { dirFile.mkdirs(); } - Files.copy(steamPNG.toPath(), titlePNG.toPath(), StandardCopyOption.REPLACE_EXISTING); + Files.copy(Path.of(steamPNG.getAbsolutePath()), titlePNG.toPath(), StandardCopyOption.REPLACE_EXISTING); } catch (URISyntaxException | IOException e) { e.printStackTrace(); } diff --git a/src/main/java/lemon/hxdd/builder/ZipAssets.java b/src/main/java/lemon/hxdd/builder/ZipAssets.java index d4551f2..1a412d2 100644 --- a/src/main/java/lemon/hxdd/builder/ZipAssets.java +++ b/src/main/java/lemon/hxdd/builder/ZipAssets.java @@ -120,6 +120,10 @@ void ExtractSingleFile(String input, String output) { ZipEntry entry; while ((entry = this.zis.getNextEntry()) != null) { if (input.equals(entry.getName())) { + File dirFile = new File(new File(path + "/" + output).getParent()); + if (!dirFile.exists()) { + dirFile.mkdirs(); + } OutputStream os = new FileOutputStream(path + "/" + output); os.write(this.zis.readAllBytes()); os.close();