You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by fi...@cirquedigital.com on 2004/10/19 03:11:03 UTC
[vfs] FileObject.getName().getPath() bug on windows
Hi,
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..
Anybody seen this before?
Thanks in advance,
- Filip
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
Re: [vfs] FileObject.getName().getPath() bug on windows
Posted by fi...@cirquedigital.com.
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
Re: [vfs/net] ftp proxy url
Posted by Mario Ivankovits <ma...@ops.co.at>.
Hello!
>Btw, did your fix for the FTP connect make it into the 1.3.0 release
>of the ftp component?
>
>
Sorry for being late!
Yes! One of the next nightlies should contain this fix.
---
Mario
Re: [vfs/net] ftp proxy url
Posted by fi...@cirquedigital.com.
> filipdef@cirquedigital.com wrote:
>
>>Does anyone know how I can specify a proxy host/port in a url ?
>>
>>
> There is not a single ftp-proxy standard, so it depends on the ftp-proxy
> you use.
> Could you please tell the type/name of your proxy?
Will investigate, it's at a customer's facility (so I don't
actually have access to it to play much with it..)
>
> If you use a socks proxy you could try the settings as described at
> http://wiki.apache.org/jakarta-commons/Net/FrequentlyAskedQuestions.
>
Yes, I asked them to set it up this way to connect to my
update center and that seems to work for http at least.
> Other proxies need a special user-name e.g. anonymous@host.com. You
> could try something like
> ftp://user%40targethost:password@proxy/
Ok, will ask them to try it with the %40 and stuff..
>
> Hope this helps!
Yes, thanks for your help.
Btw, did your fix for the FTP connect make it into the 1.3.0 release
of the ftp component?
Thanks a lot,
- Filip
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
Re: [vfs/net] ftp proxy url
Posted by Mario Ivankovits <ma...@ops.co.at>.
filipdef@cirquedigital.com wrote:
>Does anyone know how I can specify a proxy host/port in a url ?
>
>
There is not a single ftp-proxy standard, so it depends on the ftp-proxy
you use.
Could you please tell the type/name of your proxy?
If you use a socks proxy you could try the settings as described at
http://wiki.apache.org/jakarta-commons/Net/FrequentlyAskedQuestions.
Other proxies need a special user-name e.g. anonymous@host.com. You
could try something like
ftp://user%40targethost:password@proxy/
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
[vfs/net] ftp proxy url
Posted by fi...@cirquedigital.com.
Hi,
Does anyone know how I can specify a proxy host/port in a url ?
Something like ftp://user:pass@host@proxy:21:/my/path
(obviously doesn't work like this ;-) )
Thanks in advance!
- Filip
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
Re: [vfs] FileObject.getName().getPath() bug on windows
Posted by Mario Ivankovits <im...@apache.org>.
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