commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From filip...@cirquedigital.com
Subject Re: [vfs] FileObject.getName().getPath() bug on windows
Date Tue, 19 Oct 2004 09:01:56 GMT
Ah, ok, got it -- thought there would be an easy way to get
to the full path of a local file.. Will go via the URI.

Thanks,
- Filip


> filipdef@cirquedigital.com 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://c:/temp/test.jpg
> 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.
>
> --
> Mario
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message