Andreas Hartmann <andreas <at> apache.org> writes:

> 
> Sterzl Christian wrote:
> > There has been a bug in ProxyManager I spotted in
> > org.apache.lenya.net.ProxyManager#readConfig.
> >  
> > If spaces are in the path an URISyntaxException is thrown. Thus I think
> > it does make sense to add an replaceAll(" ", "%20") to the URI string.
> >  
> > configFile = new File(new
> > java.net.URI(ProxyManager.class.getClassLoader().getResource(fname).toSt
> > ring().replaceAll(" ","%20")));
> > 
> > What do you think. Do you think also other classes do have this bug?
> 
> I'm not familiar with the code, but maybe what you're suggesting
> could be achieved using URL encoding:
> 
> java.net.URLEncoder.encode(...);
> 
If I do following:
configFile = new File(new
java.net.URI(java.net.URLEncoder.encode(ProxyManager.class.getClassLoader().
getResource(fname).toString(),"US-ASCII")));
I get an IllegalArgumentException: Path is not absolute.

Thus I don't know exactly how to work with the encoder.

Does anyone know a better way then I described it?




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to