Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-1545

FileURLConnection breaks if path has spaces

XMLWordPrintable

      The org.jboss.net.protocol.file.FileURLConnection object is unable to handle paths with spaces, and seems to die.

      For example, when trying to parse an XML document through Xerces, calling the method:

      DocumentBuilder.parse(File filename)

      where "filename" is equal to "D:\path\with spaces\to\file.xml" will produce this:

      java.io.FileNotFoundException: D:\path\with%20spaces\to\file.xml
      at org.jboss.net.protocol.file.FileURLConnection.connect(FileURLConnection.java:71)
      at org.jboss.net.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:80)
      at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
      at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
      at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
      at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
      at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
      ...etc...

      Note that the filename now suddenly has "%20" in it.

      The problem persists inspite of setting JAVA_OPTS to "-Dorg.jboss.net.protocol.file.decodeFilePaths=true" as recommended in "JBAS-363" (yes, the output of "run.bat" was noted, and it did confirm that JAVA_OPTS was set).

      This is a MAJOR blocker, as it is impossible to parse XML files if their path has a space in it, and there appears to be no workaround.

              Unassigned Unassigned
              dlindquist_jira Dave Lindquist (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: