346124 ServletContext resources paths not resolved correctly when using UNC shares

git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@3214 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
Michael Gorovoy 2011-05-18 23:24:22 +00:00
parent fb7b0a3298
commit 281360ab58
3 changed files with 14 additions and 4 deletions

View File

@ -6,6 +6,7 @@ jetty-7.4.2-SNAPSHOT
+ 345873 Update jetty-ssl.xml to new style
+ 345900 Handle ipv6 with default port
+ 346014 Fixed full HttpGenerator
+ 346124 ServletContext resources paths not resolved correctly when using UNC shares
+ 346179 o.e.j.util.ScannerTest fails on MacOS X platform
+ 346181 o.e.j.server.StressTest stalls on MacOS X platform
+ JETTY-1342 Recreate selector if wakeup throws JVM bug

View File

@ -160,7 +160,7 @@ public abstract class Resource implements ResourceFactory
resource=resource.substring(2);
File file=new File(resource).getCanonicalFile();
url=new URL(URIUtil.encodePath(file.toURL().toString()));
url=file.toURI().toURL();
URLConnection connection=url.openConnection();
connection.setUseCaches(useCaches);

View File

@ -16,6 +16,7 @@ package org.eclipse.jetty.util.resource;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeTrue;
import java.io.File;
import java.io.FilePermission;
@ -27,6 +28,7 @@ import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import org.eclipse.jetty.toolchain.test.OS;
import org.eclipse.jetty.util.IO;
import org.junit.BeforeClass;
import org.junit.Test;
@ -456,7 +458,14 @@ public class ResourceTest
assertTrue("Class path resource does not exist.",resource.exists());
}
@Test
public void testUncPathResourceFile() throws Exception
{
assumeTrue(OS.IS_WINDOWS);
String uncPath = "\\\\127.0.0.1"+__userURL.toURI().getPath().replace('/','\\')+"ResourceTest.java";
Resource uncResource = Resource.newResource(uncPath, false);
assertTrue(uncResource.exists());
}
}