commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mario Ivankovits <>
Subject Re: [vfs] FileObject.getName().getPath() bug on windows
Date Tue, 19 Oct 2004 06:52:16 GMT wrote:

>It seems like FileObject.getName().getPath() incorrectly returns
>the path to the file without the drive letter on windows..
>E.g. for FileObject C:\temp\test.jpg I'm getting \temp\test.jpg
>iso C:\temp\test.jpg..
getPath() returns only the path _within the filesystem_.
If you need the full URI you have to use getName().getURI();
If you omit the scheme on resolvFile the default fileprovider will be 
used (by default the local-file one) and therefore the scheme (file://) 
will be added

For the given windows path this will return something like 
file: is the scheme
c: the filesytem-identifier
and the rest is the path

e.g. ftp:///user:pass@any_ftp_server/to/my/file.txt
ftp: is the scheme
user:pass@any_ftp_server filesystem-identifier
and the rest again the path

Hope this helps.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message