mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Omit jar: prefix from jarFileUrl
This commit is contained in:
parent
ed15345df1
commit
825fc2f7df
@ -63,12 +63,12 @@ class JarURLConnection extends java.net.JarURLConnection {
|
||||
* sensible for #getJarFileURL().
|
||||
*/
|
||||
if (separator + SEPARATOR.length() != spec.length()) {
|
||||
this.jarFileUrl = new URL("jar:" + spec);
|
||||
this.jarFileUrl = new URL(spec);
|
||||
this.jarEntryName = spec.substring(separator + 2);
|
||||
}
|
||||
else {
|
||||
// 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 {
|
||||
assertThat(jarURLConnection.getContentLength(), greaterThan(1));
|
||||
assertThat(jarURLConnection.getContent(), sameInstance((Object) this.jarFile));
|
||||
assertThat(jarURLConnection.getContentType(), equalTo("x-java/jar"));
|
||||
assertThat(jarURLConnection.getJarFileURL().toString(), equalTo("jar:file:"
|
||||
assertThat(jarURLConnection.getJarFileURL().toString(), equalTo("file:"
|
||||
+ this.rootJarFile));
|
||||
}
|
||||
|
||||
@ -216,8 +216,8 @@ public class JarFileTests {
|
||||
+ "!/nested.jar!/"));
|
||||
JarURLConnection conn = (JarURLConnection) url.openConnection();
|
||||
assertThat(conn.getJarFile(), sameInstance(nestedJarFile));
|
||||
assertThat(conn.getJarFileURL().toString(), equalTo("jar:file:"
|
||||
+ this.rootJarFile.getPath() + "!/nested.jar"));
|
||||
assertThat(conn.getJarFileURL().toString(),
|
||||
equalTo("file:" + this.rootJarFile.getPath() + "!/nested.jar"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Loading…
Reference in New Issue
Block a user