Skip to content

Commit e88bb7b

Browse files
committed
In Node, construct proper URI from Path
Sure enough, addressing the deprecation of URL constructors by substituting URI.toURL() leads to failure on Windows where Node.installSaxon used to get away with string concatenation to make a URI from a Path. Path.toUri() is a bit brain-damaged: it makes an absolute file: URI even from a relative Path, and it inserts an empty authority instead of just leaving the authority out. The latter problem is easily dealt with; installExamples was already doing so. The former we'll put up with for now.
1 parent 02f41ff commit e88bb7b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pljava-packaging/src/main/java/Node.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015-2024 Tada AB and other contributors, as listed below.
2+
* Copyright (c) 2015-2025 Tada AB and other contributors, as listed below.
33
*
44
* All rights reserved. This program and the accompanying materials
55
* are made available under the terms of the The BSD 3-Clause License
@@ -1919,7 +1919,9 @@ public static Stream<Object> installSaxon(
19191919
Path p = Paths.get(
19201920
repo, "net", "sf", "saxon", "Saxon-HE", version,
19211921
"Saxon-HE-" + version + ".jar");
1922-
return installJar(c, "file:" + p, "saxon", false);
1922+
String uri = p.toUri()
1923+
.toString().replaceFirst("^file:///", "file:/");
1924+
return installJar(c, uri, "saxon", false);
19231925
}
19241926

19251927
/**

0 commit comments

Comments
 (0)