Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] File path w/space

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Laurent Bihanic <laurent.bihanic AT atosorigin.com>
  • To: Jason Bennett <jasonab AT acm.org>
  • Cc: XOM-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] File path w/space
  • Date: Thu, 16 Jan 2003 09:48:19 +0100

Jason Bennett wrote:

I'm trying to parse an XML file, by calling the build method in Builder, passing a File object.

If, however, I pass a file object where the complete filename includes a directory name with a space, XOM throws an exception:

nu.xom.MalformedURIException: URIs cannot contain 0x20
at nu.xom.Verifier.checkURI(Verifier.java:201)

Now, I understand why URIs cannot have spaces, and I figure that I could pass a stream instead of a File. Am I just not allowed to pass a File object if that object could have a space in the path? I don't know of any way to URI'ize a File object.

File.toURL() (since JDK 1.2) or File.toURI() (new in JDK 1.4).

Laurent





Archive powered by MHonArc 2.6.24.

Top of Page