mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
修复graalvm原生打包使用http工具被转为file协议问题
This commit is contained in:
parent
87df51effc
commit
1a9d4c2c9e
@ -125,6 +125,14 @@ public class UrlUtil {
|
||||
try {
|
||||
return new URL(null, url, handler);
|
||||
} catch (final MalformedURLException e) {
|
||||
// issue#I8PY3Y
|
||||
if(e.getMessage().contains("Accessing an URL protocol that was not enabled")){
|
||||
// Graalvm打包需要手动指定参数开启协议:
|
||||
// --enable-url-protocols=http
|
||||
// --enable-url-protocols=https
|
||||
throw new HutoolException(e);
|
||||
}
|
||||
|
||||
// 尝试文件路径
|
||||
try {
|
||||
return new File(url).toURI().toURL();
|
||||
|
Loading…
x
Reference in New Issue
Block a user