Use getRawSchemeSpecificPart to preserve escape characters in uri, fix #5236 (#5237)

This commit is contained in:
Liqueur Librazy 2018-12-11 03:07:50 +08:00 committed by LexManos
parent bbf1ea41b8
commit 719ea50d1a
1 changed files with 3 additions and 3 deletions

View File

@ -72,10 +72,10 @@ public abstract class FMLCommonLaunchHandler
try {
Path path;
final URI uri = resource.toURI();
if (uri.getSchemeSpecificPart().contains("!")) {
path = Paths.get(new URI(uri.getSchemeSpecificPart().split("!")[0]));
if (uri.getRawSchemeSpecificPart().contains("!")) {
path = Paths.get(new URI(uri.getRawSchemeSpecificPart().split("!")[0]));
} else {
path = Paths.get(new URI("file://"+uri.getSchemeSpecificPart().substring(0, uri.getSchemeSpecificPart().length()-className.length())));
path = Paths.get(new URI("file://"+uri.getRawSchemeSpecificPart().substring(0, uri.getRawSchemeSpecificPart().length()-className.length())));
}
LOGGER.debug(CORE, "Found JAR {} at path {}", jarName, path.toString());
return path;