Christian Sterzl wrote:
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?
The problem is that the URLEncoder adds the protocol and server information.
You could try to add this yourself and remove it after the encoding. Maybe
you could use the debugger to see what exactly is happening.
-- Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]