Skip to content

Commit

Permalink
[FIXED JENKINS-26203] Noting merge of #1503.
Browse files Browse the repository at this point in the history
  • Loading branch information
jglick committed Jan 13, 2015
2 parents b0908bd + 6351a8a commit 08b957c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
3 changes: 3 additions & 0 deletions changelog.html
Expand Up @@ -65,6 +65,9 @@
<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>)
Expand Down
20 changes: 18 additions & 2 deletions core/src/main/java/hudson/ClassicPluginStrategy.java
Expand Up @@ -56,6 +56,8 @@
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;
Expand Down Expand Up @@ -147,8 +149,8 @@ private static Manifest loadLinkedManifest(File archive) throws IOException {

@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

Expand Down Expand Up @@ -197,7 +199,21 @@ private static Manifest loadLinkedManifest(File archive) throws IOException {
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()) {
Expand Down

0 comments on commit 08b957c

Please sign in to comment.