mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-17 22:12:25 +00:00
File.toURL() is deprecated.
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@19471 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
3ec951ec1a
commit
2dd667265b
8 files changed
+15
-15
No files matched your search
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user