From ab11be65b521980c36b3561f3933b978d5a923e0 Mon Sep 17 00:00:00 2001 From: 502647092 Date: Sun, 29 Nov 2015 18:29:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8F=92=E4=BB=B6=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E7=BC=96=E7=A0=81=E9=97=AE=E9=A2=98...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/cn/citycraft/Yum/manager/PluginsManager.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/cn/citycraft/Yum/manager/PluginsManager.java b/src/main/java/cn/citycraft/Yum/manager/PluginsManager.java index 20d96d2..b186bac 100644 --- a/src/main/java/cn/citycraft/Yum/manager/PluginsManager.java +++ b/src/main/java/cn/citycraft/Yum/manager/PluginsManager.java @@ -2,9 +2,11 @@ package cn.citycraft.Yum.manager; import java.io.File; import java.io.IOException; +import java.io.UnsupportedEncodingException; import java.lang.reflect.Field; import java.net.URL; import java.net.URLClassLoader; +import java.net.URLDecoder; import java.util.ArrayList; import java.util.Iterator; import java.util.List; @@ -177,7 +179,10 @@ public class PluginsManager { @SuppressWarnings("resource") final URLClassLoader ucl = (URLClassLoader) cl; final URL url = ucl.getURLs()[0]; - file = new File(url.getFile()); + try { + file = new File(URLDecoder.decode(url.getFile(), "UTF-8")); + } catch (final UnsupportedEncodingException e) { + } } return file; }