Incorrect URL (systemId) handling : specials characters not decoded
-------------------------------------------------------------------

                 Key: XALANJ-2461
                 URL: https://issues.apache.org/jira/browse/XALANJ-2461
             Project: XalanJ2
          Issue Type: Bug
      Security Level: No security risk; visible to anyone (Ordinary problems in 
Xalan projects.  Anybody can view the issue.)
          Components: transformation
    Affects Versions: 2.7
         Environment: Windows XP SP2, Sun JDK 1.6.0_01, Xalan 2.7.0
            Reporter: Marc-Olivier PICOREAU


I think there is a bug in class TransformerIdentityImpl, method 
createResultContentHandler.
A file-URL is converted to a file simply by removing file:// or file:/ prefix.
It works until we have URL-encoded specials characters like spaces converted to 
%20.

String fileURL = sresult.getSystemId();
[...]
m_outputStream = new java.io.FileOutputStream(fileURL);

I think the following solution would be great (already suggested in this issue 
: XALANJ-2182)

String fileURL = sresult.getSystemId();
File file = new File(new URI(fileURL));
m_outputStream = new java.io.FileOutputStream(file);

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to