Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 351576 - Do not use deprecated method File.toURL()
Summary: Do not use deprecated method File.toURL()
Status: RESOLVED FIXED
Alias: None
Product: Jetty
Classification: RT
Component: other (show other bugs)
Version: 7.5.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 7.5.x   Edit
Assignee: Greg Wilkins CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 351443 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-07-08 10:09 EDT by Michael Gorovoy CLA
Modified: 2011-09-20 03:22 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Gorovoy CLA 2011-07-08 10:09:47 EDT
Below is the list of methods  in Jetty 7 that call deprecated method java.io.File.toURL(), that according to http://download.oracle.com/javase/6/docs/api/java/io/File.html#toURL() "does not automatically escape characters that are illegal in URLs" that causes numerous issues with invalid URLs being generated for valid paths that contain characters that are not allowed in URLs. In order to fix these issues, we need to change code to use File.toURI().toURL() method calls instead.

org.mortbay.jetty.webapp.WebAppClassLoader.addClassPath(String)
org.mortbay.jetty.ant.WebApplicationProxyImpl.applyConfiguration()
org.mortbay.jetty.ant.ServerProxyImpl.applyJettyXml()
org.mortbay.jetty.plugin.AbstractJettyMojo.configureWebApplication()
org.mortbay.jetty.plugin.JettyWebAppContext.doStart()
org.eclipse.jetty.start.Classpath.getClassLoader()
org.eclipse.jetty.start.Classpath.getClassLoader()
org.mortbay.jetty.plugin.JettyRunMojo.getDependencyFiles()
org.mortbay.resource.Resource.newResource(String, boolean)
org.eclipse.jetty.xml.XmlParser.parse(File)
org.eclipse.jetty.xml.XmlParser.parse(File)
org.mortbay.xml.XmlParser.parse(File)
org.eclipse.jetty.deploy.ContextDeployer.setConfigurationDir(File)
org.eclipse.jetty.deploy.ContextDeployer.setConfigurationDir(File)
org.mortbay.jetty.deployer.ContextDeployer.setConfigurationDir(File)
org.mortbay.jetty.integration.jaas.TestJAASUserRealm.setUp()
org.mortbay.jetty.jspc.plugin.JspcMojo.setUpClassPath(List)
org.mortbay.jetty.plugin.RuntimeDependencyResolver.transitivelyResolvePomDependencies(MavenProjectBuilder, String, String, String, boolean)

This issue is related to bug 350634.
Comment 1 Michael Gorovoy CLA 2011-07-11 10:34:23 EDT
Committed 2001-07-08.
Comment 2 Michael Gorovoy CLA 2011-07-11 10:36:07 EDT
Keeping this open while waiting for an opportunity to chat with Hugues about fixing up the OSGI modules as well.

-Michael
Comment 3 Michael Gorovoy CLA 2011-07-21 14:38:28 EDT
Hugues, I need to chat with you about using new method I created Resource.toURL(File) in OSGI code. Please hit me up when you are online, or chime in here.

-Michael
Comment 4 Michael Gorovoy CLA 2011-07-21 14:42:15 EDT
*** Bug 351443 has been marked as a duplicate of this bug. ***
Comment 5 Greg Wilkins CLA 2011-09-20 03:22:25 EDT
These appear to have been fixed