Steve Lawrence created DAFFODIL-3063:
----------------------------------------

             Summary: File names with spaces do not work
                 Key: DAFFODIL-3063
                 URL: https://issues.apache.org/jira/browse/DAFFODIL-3063
             Project: Daffodil
          Issue Type: Bug
          Components: Front End
            Reporter: Steve Lawrence


Spaces in file names do not currently work. We end up with errors about unable  
find files.

Note that we do have two tests in TestGeneral.scala (TestSpace1 and TestSpace2) 
that are supposed to make sure spaces work as expected, but the tests actually 
expect an error which isn't correct. Spaces in file names should 

Note that things like schemaLocation technically should be a URI and so spaces 
should be replaced with %20 in a XSD file, but I think even that does not work. 
And to be most userfriendly, it might be helpful to support actual spaces and 
replace them with %20 ourselves.

There are a number of comments related to some issues and potential fixes in 
this PR:

https://github.com/apache/daffodil/pull/1605

The core issue is that in many places we expect strings to be valid URI's, but 
spaces are not legal in URI's. Maybe the simplest and most user friendly thing 
to do is when we get a string from a user that we expect to be a URI we replace 
all spaces with %20. And in the few places where we don't actually want a URI 
(e.g. Class.getResource) then we can convert those %20's back to spaces.

Alternatively, we could convert these strings to actual URI objects and then 
change the APIs to expect URI instead of Strings. And in cases where we don't 
want a URI we can use things like URI.getPath which decodes %20's . The main 
downside to this is some APIs, while not officially public, are sometimes used 
outside of Daffodil, so we need to take careful consideration if we want to 
change these APIs or if it could cause too much breakage.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to