geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel S. Haischt" ...@daniel.stefan.haischt.name>
Subject Re: [core] Directories w/spaces
Date Tue, 26 Aug 2003 15:05:12 GMT
Jason Dillon wrote:

>> String configFromSomewhere = ....
>> File file = new File(new URI(URLEncoder(configFromSomewhere));
> 
> 
> Can you actually read a file using this?
> 

what i just did not read while using the URLEncoder class
is that it is meant to encode HTML form field values which
will be passed to a CGI etc..

that means it will not encode complete URLs. this is the
reason why the protocol (file:///) part gets for example
encoded to

  -> file%3A%2F%2F%2F

and finally according to the doc a whitespace gets
converted to a plus sign but according RFC 2396 you
will need a %20 escape sequence.

so i am wondering how the string 'configFromSomewhere'
gets encoded accordingly if it contains the protocol
part of an URL or whitespaces.

regards

daniel s. haischt
-- 



Mime
View raw message