tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 13983] - RMI call from Web Application throws SocketException if CATALINA_HOME has a space in it
Date Wed, 11 Feb 2004 18:19:58 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13983>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13983

RMI call from Web Application throws SocketException if CATALINA_HOME has a space in it





------- Additional Comments From sajid.merchant@ca.com  2004-02-11 18:19 -------
I was able to fix this problem by changing the getURL method in the 
Webappclassloader. Also, i've only tested this with 4.1.29 so, even though i 
think this will work with other versions, its not been tested with those.

Here is the new getURL method
    
    protected URL getURL(File file)
        throws MalformedURLException {

        File realFile = file;
        try {
            realFile = realFile.getCanonicalFile();
        } catch (IOException e) {
            // Ignore
        }

        String fileStr = "file:" + realFile.getPath();
  		StringBuffer sb = new StringBuffer(fileStr.length());
  		for(int i=0; i< fileStr.length();i++)
  		{
  			char c = fileStr.charAt(i);
  			if(c != ' ')
  			{
  				sb.append(c);
  			}
  			else
  			{
  				sb.append("%20");
  			}
 		}
        return new URL(sb.toString());
    }

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


Mime
View raw message