Open PaulRambags opened 1 year ago
@PaulRambags Thanks for the report. This seems to be a Java issue with the 2-slash form of UNC URIs.
Here is a possible solution:
--- a/framework/framework-core/src/main/java/org/daisy/pipeline/script/ScriptInput.java
+++ b/framework/framework-core/src/main/java/org/daisy/pipeline/script/ScriptInput.java
@@ -195,6 +195,12 @@ public class ScriptInput {
throw new FileNotFoundException(
"Input not found: expected an absolute file or a relative path, but got: " + uri);
try {
+ // Windows: try to convert 2-slash UNC form to 4-slash form
+ if (uri.getAuthority() != null && !"".equals(uri.getAuthority()))
+ try {
+ uri = new URI("file", "", "//" + uri.getAuthority() + uri.getPath(), uri.getQuery(), uri.getFragment());
+ } catch (URISyntaxException e) {
+ }
absoluteFile = new File(uri);
} catch (IllegalArgumentException e) {
throw new FileNotFoundException(
Someone would need to test it on Windows. There might be similar issues in different places in the code.
Expected Behavior
I'm trying to run the Daisy Pipeline CLI with an UNC path and I expect that the DTBook is processed.
Actual Behavior
The job is not processed with error
Job request is not valid
.Steps to Reproduce
DEV
, create a shareTemp
so that new files can be created in\\DEV\Temp
and so that they can be read too.\\DEV\Temp\dtbook.xml
dp2.exe dtbook-to-pef --source \\DEV\Temp\dtbook.xml --output \\DEV\Temp\output-folder
Details
Changing the backward slashes to forward slashes gives the same issue.
Environment
Logs