From: Christian S. <chr...@ne...> - 2003-03-14 08:43:18
|
not sure if that matters, but I am just doing some custom XML parsing with Xerces, in the course of which I had to resolve a file by supplying an URL to the local file system. After some trial and error, I found that URLs of the form "file:mylocalfile.xml" did the job, whereas "file://mylocalfile.xml" failed. InputSource in = new InputSource("file:dtw.xml"); Mike Bowler wrote: > Brad Clarke wrote: > >> Best I can find is http://www.w3.org/Addressing/rfc1738.txt section >> 3.10. It's not very descriptive though > > > That document says: > > The file URL scheme is unusual in that it does not specify an > Internet protocol or access method for such files; as such, its > utility in network protocols between hosts is limited. > > Which would seem to imply that there isn't a portable way of specifying > a file url. I would hope that this is wrong but I haven't found > anything that defines the spec for file:// > > Now this doesn't mean that I can't add support for loading files off the > file system but it does mean that this support won't be via file urls. > One option that I've been tossing around is mapping http urls to the > file system. For example, you would be able to tell HtmlUnit that any > request to http://foo.com/bar/* would map to d:\source\foo and then you > would write your code to access http://foo.com/bar/whatever. > |