You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2022/01/04 20:45:51 UTC

[jena] branch main updated: JENA-2241: Filename as URI

This is an automated email from the ASF dual-hosted git repository.

andy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/jena.git


The following commit(s) were added to refs/heads/main by this push:
     new d91da8d  JENA-2241: Filename as URI
     new ee15a4c  Merge pull request #1156 from afs/fix-filename
d91da8d is described below

commit d91da8dd5de8c73508c65be9a1ec4837d6ecf65a
Author: Andy Seaborne <an...@apache.org>
AuthorDate: Tue Jan 4 13:53:48 2022 +0000

    JENA-2241: Filename as URI
---
 jena-cmds/src/main/java/riotcmd/CmdLangParse.java | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/jena-cmds/src/main/java/riotcmd/CmdLangParse.java b/jena-cmds/src/main/java/riotcmd/CmdLangParse.java
index ec5a87c..8cdd42a 100644
--- a/jena-cmds/src/main/java/riotcmd/CmdLangParse.java
+++ b/jena-cmds/src/main/java/riotcmd/CmdLangParse.java
@@ -31,6 +31,7 @@ import arq.cmdline.ModLangParse ;
 import arq.cmdline.ModTime ;
 import org.apache.jena.Jena ;
 import org.apache.jena.atlas.io.IO ;
+import org.apache.jena.atlas.lib.IRILib;
 import org.apache.jena.atlas.lib.Pair ;
 import org.apache.jena.cmd.ArgDecl;
 import org.apache.jena.cmd.CmdException;
@@ -246,6 +247,10 @@ public abstract class CmdLangParse extends CmdGeneral
             filename = "stdin";
             builder.source(System.in);
         } else {
+            // Convert spaces and other characters in file names.
+            // File handling will reverse to open the file correctly 
+            // but for base name generation we want the %20 form.
+            filename = IRILib.filenameToIRI(filename);
             builder.source(filename);
         }
         return parseRIOT(builder, filename);