diff --git a/core/src/main/java/hudson/ClassicPluginStrategy.java b/core/src/main/java/hudson/ClassicPluginStrategy.java index 3bf57aeae1db45c6464519720cea9fe4754a31b5..82f9612bccb57e8a16cd49cc9941f01fd82af8c0 100644 --- a/core/src/main/java/hudson/ClassicPluginStrategy.java +++ b/core/src/main/java/hudson/ClassicPluginStrategy.java @@ -123,19 +123,19 @@ public class ClassicPluginStrategy implements PluginStrategy { baseResourceURL = resolve(archive, manifest.getMainAttributes().getValue("Resource-Path")) - .toURL(); + .toURI().toURL(); } else { File classes = new File(expandDir, "WEB-INF/classes"); if (classes.exists()) - paths.add(classes.toURL()); + paths.add(classes.toURI().toURL()); File lib = new File(expandDir, "WEB-INF/lib"); File[] libs = lib.listFiles(JAR_FILTER); if (libs != null) { for (File jar : libs) - paths.add(jar.toURL()); + paths.add(jar.toURI().toURL()); } - baseResourceURL = expandDir.toURL(); + baseResourceURL = expandDir.toURI().toURL(); } File disableFile = new File(archive.getPath() + ".disabled"); if (disableFile.exists()) { @@ -259,12 +259,12 @@ public class ClassicPluginStrategy implements PluginStrategy { fs.setDir(dir); fs.setIncludes(file.getName()); for( String included : fs.getDirectoryScanner(new Project()).getIncludedFiles() ) { - paths.add(new File(dir,included).toURL()); + paths.add(new File(dir,included).toURI().toURL()); } } else { if(!file.exists()) throw new IOException("No such file: "+file); - paths.add(file.toURL()); + paths.add(file.toURI().toURL()); } } } diff --git a/core/src/main/java/hudson/lifecycle/WindowsInstallerLink.java b/core/src/main/java/hudson/lifecycle/WindowsInstallerLink.java index 7e303c46802dcc5b58abd6a94a2a95c64e7235db..5d1365cd887ebb138847895694400353434b2332 100644 --- a/core/src/main/java/hudson/lifecycle/WindowsInstallerLink.java +++ b/core/src/main/java/hudson/lifecycle/WindowsInstallerLink.java @@ -121,7 +121,7 @@ public class WindowsInstallerLink extends ManagementLink { copy(req, rsp, dir, getClass().getResource("/windows-service/hudson.exe"), "hudson.exe"); copy(req, rsp, dir, getClass().getResource("/windows-service/hudson.xml"), "hudson.xml"); if(!hudsonWar.getCanonicalFile().equals(new File(dir,"hudson.war").getCanonicalFile())) - copy(req, rsp, dir, hudsonWar.toURL(), "hudson.war"); + copy(req, rsp, dir, hudsonWar.toURI().toURL(), "hudson.war"); // install as a service ByteArrayOutputStream baos = new ByteArrayOutputStream(); diff --git a/core/src/main/java/hudson/model/Slave.java b/core/src/main/java/hudson/model/Slave.java index b50fa00f950255082ad875f1149009efd10b99ea..7f5b82372d4494bdfb5d8a933f9e2496a14e0d01 100644 --- a/core/src/main/java/hudson/model/Slave.java +++ b/core/src/main/java/hudson/model/Slave.java @@ -356,7 +356,7 @@ public abstract class Slave extends Node implements Serializable { URL res = Hudson.getInstance().servletContext.getResource("/WEB-INF/" + fileName); if(res==null) { // during the development this path doesn't have the files. - res = new URL(new File(".").getAbsoluteFile().toURL(),"target/generated-resources/WEB-INF/"+fileName); + res = new URL(new File(".").getAbsoluteFile().toURI().toURL(),"target/generated-resources/WEB-INF/"+fileName); } return res; } diff --git a/maven-agent/src/main/java/hudson/maven/agent/Main.java b/maven-agent/src/main/java/hudson/maven/agent/Main.java index c0a5fc0d77639de4e49740c60600a34f873b996b..27cd4c7c2a7d2f454acf8bce82c90c0790efd253 100644 --- a/maven-agent/src/main/java/hudson/maven/agent/Main.java +++ b/maven-agent/src/main/java/hudson/maven/agent/Main.java @@ -114,7 +114,7 @@ public class Main { // this needs to be able to see maven. ClassRealm remoting = new DefaultClassRealm(launcher.getWorld(),"hudson-remoting", launcher.getSystemClassLoader()); remoting.setParent(launcher.getWorld().getRealm("plexus.core.maven")); - remoting.addConstituent(remotingJar.toURL()); + remoting.addConstituent(remotingJar.toURI().toURL()); final Socket s = new Socket((String)null,tcpPort); diff --git a/remoting/src/main/java/hudson/remoting/RemoteClassLoader.java b/remoting/src/main/java/hudson/remoting/RemoteClassLoader.java index 76a8222b664679e4974361a01cdeee4aa47749d0..cbd43e7187c7bc9cc957fb793bebf35616496cca 100644 --- a/remoting/src/main/java/hudson/remoting/RemoteClassLoader.java +++ b/remoting/src/main/java/hudson/remoting/RemoteClassLoader.java @@ -137,7 +137,7 @@ final class RemoteClassLoader extends URLClassLoader { if(f.exists()) // be defensive against external factors that might have deleted this file, since we use /tmp // see http://www.nabble.com/Surefire-reports-tt17554215.html - return f.toURL(); + return f.toURI().toURL(); } long startTime = System.nanoTime(); @@ -151,7 +151,7 @@ final class RemoteClassLoader extends URLClassLoader { File res = makeResource(name, image); resourceMap.put(name,res); - return res.toURL(); + return res.toURI().toURL(); } catch (IOException e) { throw new Error("Unable to load resource "+name,e); } @@ -161,7 +161,7 @@ final class RemoteClassLoader extends URLClassLoader { Vector r = new Vector(files.size()); for (File f : files) { if(!f.exists()) return null; // abort - r.add(f.toURL()); + r.add(f.toURI().toURL()); } return r; } diff --git a/remoting/src/test/java/hudson/remoting/DummyClassLoader.java b/remoting/src/test/java/hudson/remoting/DummyClassLoader.java index d81a4eb2b2c6d72b85f49b79b6225d0a13f9517b..052c42d3cc92fa99a3860656615a58a1faffb5c6 100644 --- a/remoting/src/test/java/hudson/remoting/DummyClassLoader.java +++ b/remoting/src/test/java/hudson/remoting/DummyClassLoader.java @@ -83,7 +83,7 @@ class DummyClassLoader extends ClassLoader { os.write(loadTransformedClassImage("hudson.remoting.test.TestCallable")); os.close(); f.deleteOnExit(); - return f.toURL(); + return f.toURI().toURL(); } catch (IOException e) { return null; } diff --git a/test/src/main/java/org/jvnet/hudson/test/HudsonHomeLoader.java b/test/src/main/java/org/jvnet/hudson/test/HudsonHomeLoader.java index dc4a25b0e2c08b8e4093f4bff69e2df898ef7624..639820a60d650c6acd2b331ec9b16123ef3a80b7 100644 --- a/test/src/main/java/org/jvnet/hudson/test/HudsonHomeLoader.java +++ b/test/src/main/java/org/jvnet/hudson/test/HudsonHomeLoader.java @@ -65,7 +65,7 @@ public interface HudsonHomeLoader { * Either a zip file or a directory that contains the home image. */ public CopyExisting(File source) throws MalformedURLException { - this(source.toURL()); + this(source.toURI().toURL()); } /** diff --git a/test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java b/test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java index 53dc391002ba858c2fb9f3dae7b5b555858d5d5f..3495202e845ad1a2b9c20aab8c50f652b02e370c 100644 --- a/test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java +++ b/test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java @@ -963,7 +963,7 @@ public abstract class HudsonTestCase extends TestCase { if(dir.exists() && MetaClassLoader.debugLoader==null) try { MetaClassLoader.debugLoader = new MetaClassLoader( - new URLClassLoader(new URL[]{dir.toURL()})); + new URLClassLoader(new URL[]{dir.toURI().toURL()})); } catch (MalformedURLException e) { throw new AssertionError(e); }