Commit 825fc2f7 authored by Dave Syer's avatar Dave Syer

Omit jar: prefix from jarFileUrl

parent ed15345d
...@@ -63,12 +63,12 @@ class JarURLConnection extends java.net.JarURLConnection { ...@@ -63,12 +63,12 @@ class JarURLConnection extends java.net.JarURLConnection {
* sensible for #getJarFileURL(). * sensible for #getJarFileURL().
*/ */
if (separator + SEPARATOR.length() != spec.length()) { if (separator + SEPARATOR.length() != spec.length()) {
this.jarFileUrl = new URL("jar:" + spec); this.jarFileUrl = new URL(spec);
this.jarEntryName = spec.substring(separator + 2); this.jarEntryName = spec.substring(separator + 2);
} }
else { else {
// The root of the archive (!/) // The root of the archive (!/)
this.jarFileUrl = new URL("jar:" + spec.substring(0, separator)); this.jarFileUrl = new URL(spec.substring(0, separator));
} }
} }
......
...@@ -150,7 +150,7 @@ public class JarFileTests { ...@@ -150,7 +150,7 @@ public class JarFileTests {
assertThat(jarURLConnection.getContentLength(), greaterThan(1)); assertThat(jarURLConnection.getContentLength(), greaterThan(1));
assertThat(jarURLConnection.getContent(), sameInstance((Object) this.jarFile)); assertThat(jarURLConnection.getContent(), sameInstance((Object) this.jarFile));
assertThat(jarURLConnection.getContentType(), equalTo("x-java/jar")); assertThat(jarURLConnection.getContentType(), equalTo("x-java/jar"));
assertThat(jarURLConnection.getJarFileURL().toString(), equalTo("jar:file:" assertThat(jarURLConnection.getJarFileURL().toString(), equalTo("file:"
+ this.rootJarFile)); + this.rootJarFile));
} }
...@@ -216,8 +216,8 @@ public class JarFileTests { ...@@ -216,8 +216,8 @@ public class JarFileTests {
+ "!/nested.jar!/")); + "!/nested.jar!/"));
JarURLConnection conn = (JarURLConnection) url.openConnection(); JarURLConnection conn = (JarURLConnection) url.openConnection();
assertThat(conn.getJarFile(), sameInstance(nestedJarFile)); assertThat(conn.getJarFile(), sameInstance(nestedJarFile));
assertThat(conn.getJarFileURL().toString(), equalTo("jar:file:" assertThat(conn.getJarFileURL().toString(),
+ this.rootJarFile.getPath() + "!/nested.jar")); equalTo("file:" + this.rootJarFile.getPath() + "!/nested.jar"));
} }
@Test @Test
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment