git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@8632 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2008-04-16 01:58:10 +00:00
1 parent 2c5d33cb79
commit fb5127ed12
1 file changed
+6
@@ -32,6 +32,12 @@ public class Which {
return new File(decode(new URL(resURL).getPath()));
}
if(resURL.startsWith("code-source:/")) {
// OC4J apparently uses this. See http://www.nabble.com/Hudson-on-OC4J-tt16702113.html
resURL = resURL.substring("code-source:/".length(), resURL.lastIndexOf('!')); // cut off jar: and the file name portion
return new File(decode(new URL(resURL).getPath()));
}
if(resURL.startsWith("file:")) {
// unpackaged classes
int n = clazz.getName().split("\\.").length; // how many slashes do wo need to cut?