Don't use URL#toURI to transform a URL into a File; that does not work when spaces and other characters appear on the path.

git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@2900 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
Hugues Malphettes 2011-03-17 09:19:08 +00:00
parent 3ec94365ae
commit 903dd14656
1 changed files with 3 additions and 2 deletions

View File

@ -25,6 +25,7 @@ import java.util.zip.ZipFile;
import org.eclipse.jetty.osgi.boot.utils.BundleFileLocatorHelper;
import org.eclipse.jetty.util.URIUtil;
import org.eclipse.jetty.util.resource.FileResource;
import org.osgi.framework.Bundle;
/**
@ -70,8 +71,8 @@ public class DefaultFileLocatorHelper implements BundleFileLocatorHelper
if (url.getProtocol().equals("file"))
{
// some osgi frameworks do use the file protocole directly in some
// situations
return new File(url.toURI()).getParentFile().getParentFile();
// situations. Do use the FileResource to transform the URL into a File: URL#toURI is broken
return new FileResource(url).getFile().getParentFile().getParentFile();
}
else if (url.getProtocol().equals("bundleentry"))
{