-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tuesday 01 June 2004 17:49, Jeroen Frijters wrote:
> This isn't going to work on Windows. I don't really know what the right
> solution is (file paths and URIs are driving me insane), but I think, at
> the very least, we need something like this:
>
> String path = abspath.replace(separatorChar, '/');
[...]
I think you want:

String path = new File(getAbsolutePath()).getConicalPath().
        replace(separatorChar, '/');
[...]

or similar :)

The point being that you want a cleaned up path as well as an absolute 
path.
so the relative paths come out correctly:
foo/bar.java -> file:///home/zander/foo/bar.java
foo/../foo/bar.java -> file:///home/zander/foo/bar.java


To continue the little code example:
> if(!path.startsWith("/"))
> � path = "/" + path;
> return new URI(...);

If you use the getAbsolutePath() you don't need this check.

- -- 
Thomas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAvNpBCojCW6H2z/QRAvj8AJ9dR7huEDthVO6WYvj2hB1K36kISQCgntX+
svtHs0AxxyII0ifpOxVy//M=
=leKT
-----END PGP SIGNATURE-----


_______________________________________________
Classpath mailing list
[EMAIL PROTECTED]
http://lists.gnu.org/mailman/listinfo/classpath

Reply via email to