Fixed #60
This commit is contained in:
@@ -19,6 +19,7 @@ package org.jackhuang.hellominecraft.launcher.core.version;
|
||||
|
||||
import org.jackhuang.hellominecraft.launcher.core.download.DownloadType;
|
||||
import org.jackhuang.hellominecraft.util.StrUtils;
|
||||
import org.jackhuang.hellominecraft.util.system.IOUtils;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -38,7 +39,7 @@ public class LibraryDownloadInfo extends GameDownloadInfo {
|
||||
if (path == null)
|
||||
return null;
|
||||
else
|
||||
myURL += path.replace('\\', '/');
|
||||
myURL = IOUtils.addURLSeparator(myURL) + path.replace('\\', '/');
|
||||
return myURL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,6 +54,15 @@ public class IOUtils {
|
||||
return path + File.separatorChar;
|
||||
}
|
||||
|
||||
public static String addURLSeparator(String path) {
|
||||
if (path == null || path.trim().length() == 0)
|
||||
return "";
|
||||
if (path.charAt(path.length() - 1) == '/')
|
||||
return path;
|
||||
else
|
||||
return path + '/';
|
||||
}
|
||||
|
||||
public static boolean isSeparator(char ch) {
|
||||
return ch == File.separatorChar || ch == '/' || ch == '\\';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user