diff --git a/src/main/java/com/dostalgia/UploadResource.java b/src/main/java/com/dostalgia/UploadResource.java index 17a5f31..e498faf 100644 --- a/src/main/java/com/dostalgia/UploadResource.java +++ b/src/main/java/com/dostalgia/UploadResource.java @@ -113,7 +113,7 @@ public class UploadResource { game.setBundleFile(bundleFile); game.setPlatform(platform); // Store the selected executable and the full list for the UI picker - String relMain = extractDir.relativize(Path.of(mainExe)).toString().replace('\', '/'); + String relMain = extractDir.relativize(Path.of(mainExe)).toString().replace('\\', '/'); game.setExecutable(relMain); game.setExecutables(findAllExecutables(extractDir)); if (setupExe != null) { @@ -249,7 +249,7 @@ public class UploadResource { public FileVisitResult visitFile(Path f, BasicFileAttributes a) { String name = f.getFileName().toString().toLowerCase(); if (name.endsWith(".exe") || name.endsWith(".com") || name.endsWith(".bat")) { - result.add(dir.relativize(f).toString().replace('\', '/')); + result.add(dir.relativize(f).toString().replace('\\', '/')); } return FileVisitResult.CONTINUE; } @@ -428,7 +428,7 @@ public class UploadResource { var allDirs = new java.util.TreeSet(); try (var walk = Files.walk(extractDir)) { walk.filter(Files::isRegularFile).forEach(f -> { - String entryName = extractDir.relativize(f).toString().replace('\', '/'); + String entryName = extractDir.relativize(f).toString().replace('\\', '/'); int idx = entryName.lastIndexOf('/'); while (idx >= 0) { allDirs.add(entryName.substring(0, idx + 1)); @@ -449,7 +449,7 @@ public class UploadResource { .sorted() .forEach(f -> { try { - String entryName = extractDir.relativize(f).toString().replace('\', '/'); + String entryName = extractDir.relativize(f).toString().replace('\\', '/'); zos.putNextEntry(new java.util.zip.ZipEntry(entryName)); Files.copy(f, zos); zos.closeEntry(); @@ -471,7 +471,7 @@ public class UploadResource { .sorted() .forEach(f -> { try { - String entryName = extractDir.relativize(f).toString().replace('\', '/'); + String entryName = extractDir.relativize(f).toString().replace('\\', '/'); zos.putNextEntry(new java.util.zip.ZipEntry(entryName)); Files.copy(f, zos); zos.closeEntry(); @@ -492,11 +492,11 @@ public class UploadResource { /** * Split a relative executable path into its directory and file parts. - * If relExe contains a '/' (or '\'), returns {dir, file}. + * If relExe contains a '/' (or '\\'), returns {dir, file}. * If relExe is just a filename, returns {null, relExe}. */ private static String[] splitDirExe(String relExe) { - int idx = relExe.replace('\', '/').lastIndexOf('/'); + int idx = relExe.replace('\\', '/').lastIndexOf('/'); if (idx >= 0) { return new String[]{relExe.substring(0, idx), relExe.substring(idx + 1)}; }