Fix Windows path handling for nested jars
Update `Path` creation for nested locations to allow both UNC and classic file references to be used. This commit attempts to align our URL handling with that of standard file URLs. The `NestedLocation` class no longer attempts to remove leading all `\` characters and instead only removes the first `\` when the second char is `:`. This duplicates the logic found in Java's own internal `WindowsUriSupport` class which is used when calling `Path.of(url)` with a `file:` URL. Fixes gh-40549
This commit is contained in:
@@ -85,7 +85,7 @@ class NestedLocationTests {
|
||||
@Test
|
||||
void fromUrlWhenNoPathThrowsException() {
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> NestedLocation.fromUrl(new URL("nested:")))
|
||||
.withMessageContaining("'path' must not be empty");
|
||||
.withMessageContaining("'location' must not be empty");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user