提交 08b957c1 编写于 作者: J Jesse Glick

[FIXED JENKINS-26203] Noting merge of #1503.

......@@ -65,6 +65,9 @@ Upcoming changes</a>
<li class=bug>
Folder loading broken when child item loading throws exception.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-22811">issue 22811</a>)
<li class=bug>
Plugin icon images were broken when running Jenkins from a UNC path.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-26203">issue 26203</a>)
<li class=bug>
Allow admin signup from <code>/manage</code> as well.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-26382">issue 26382</a>)
......
......@@ -56,6 +56,8 @@ import java.io.FileInputStream;
import java.io.FilenameFilter;
import java.io.IOException;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.net.URI;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
......@@ -147,8 +149,8 @@ public class ClassicPluginStrategy implements PluginStrategy {
@Override public PluginWrapper createPluginWrapper(File archive) throws IOException {
final Manifest manifest;
URL baseResourceURL;
URL baseResourceURL = null;
File expandDir = null;
// if .hpi, this is the directory where war is expanded
......@@ -197,7 +199,21 @@ public class ClassicPluginStrategy implements PluginStrategy {
if (libs != null)
paths.addAll(Arrays.asList(libs));
baseResourceURL = expandDir.toURI().toURL();
try {
Class pathJDK7 = Class.forName("java.nio.file.Path");
Object toPath = File.class.getMethod("toPath").invoke(expandDir);
URI uri = (URI) pathJDK7.getMethod("toUri").invoke(toPath);
baseResourceURL = uri.toURL();
} catch (NoSuchMethodException e) {
throw new Error(e);
} catch (ClassNotFoundException e) {
baseResourceURL = expandDir.toURI().toURL();
} catch (InvocationTargetException e) {
throw new Error(e);
} catch (IllegalAccessException e) {
throw new Error(e);
}
}
File disableFile = new File(archive.getPath() + ".disabled");
if (disableFile.exists()) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册