----- Original Message ----- From: "Thomas DeWeese" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Friday, May 13, 2005 12:07 PM
Subject: Re: relative URIs?
Hi Lukasz,
Lukasz Matuszczak wrote:
Try to put doc/test.svg in the folder where batik is installed and after starting Squiggle put file:doc/test.svg in Location field.
These are not valid URL's. As soon as you put a protocol on a URL you must specify an absolute URL. Don't pay too much attention to how the Location field operates it tries to be nice to you. The canvas always requires an absolute URL.
The problem is the I'm not converting File object to URL (toURL method always provides absolute URLs), because i have String "file:doc/test.svg" in the configuration of my application.
Then your application is in error. You need to give an absolute URL so Batik has something to resolve against.
As far as I know file URI, start with file:/ eg: file:/c://something (on Windows) and file:/home/something (on Unix), It is not file:something
Correct, well almost, file URLs always starts with 'file:///' - yes three slashes, many 'short cuts' are supported by lots of software but this is what the RFC on URLs says. This is because the format for a URL is '<protocol>://[<host>[:<port>]]/<path on server>' A file URL has an empty host and port.
I think the file:/ means that this is an absolute URI path, so file:/C:/programs/batik/batik-1.6/init.svg is absolute URI but file:init.svg is relative and I want to resolve it against the my application working directory.
Well then I would suggest that you resolve it against your application working directory and pass the absolute URL from that to Batik (new File("init.svg").toURL()).
Thank you for this clarification, Thomas. Best regards Lukasz Matuszczak
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
