修复插件更新编码问题...

This commit is contained in:
502647092 2015-11-29 18:29:19 +08:00
parent 551029310d
commit ab11be65b5

View File

@ -2,9 +2,11 @@ package cn.citycraft.Yum.manager;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.net.URL; import java.net.URL;
import java.net.URLClassLoader; import java.net.URLClassLoader;
import java.net.URLDecoder;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
@ -177,7 +179,10 @@ public class PluginsManager {
@SuppressWarnings("resource") @SuppressWarnings("resource")
final URLClassLoader ucl = (URLClassLoader) cl; final URLClassLoader ucl = (URLClassLoader) cl;
final URL url = ucl.getURLs()[0]; 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; return file;
} }