Fix messy name of installed modpack game

This commit is contained in:
huanghongxun
2018-11-06 22:03:43 +08:00
parent 1c346c97a8
commit 44ac3bc900
3 changed files with 8 additions and 9 deletions

View File

@@ -20,7 +20,6 @@ package org.jackhuang.hmcl.util.io;
import java.io.File;
import java.io.IOException;
import java.nio.file.FileSystem;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.spi.FileSystemProvider;
import java.util.HashMap;
@@ -88,7 +87,7 @@ public final class CompressingUtils {
*/
public static String readTextZipEntry(File zipFile, String name) throws IOException {
try (FileSystem fs = createReadOnlyZipFileSystem(zipFile.toPath())) {
return new String(Files.readAllBytes(fs.getPath(name)));
return FileUtils.readText(fs.getPath(name));
}
}