billbarker    02/05/16 19:32:12

  Modified:    util/java/org/apache/tomcat/util IntrospectionUtils.java
  Log:
  Fix for brain-dead 1.1.x JDK implementations of java.io.File.
  
  It seems that at least some version of 1.1.x believe that:
  new File("/lib/").getParent() == "/lib"
  
  By stripping the File.separator off the end, it is possible to guess $TOMCAT_INSTALL 
from the jar file location.  At least Sun's 1.3.1 is still happy with this.  If any 
other JDK doesn't like this, we can try to be smarter.
  
  Fix for bug #9165.
  Reported by: Alberto Squassabia [EMAIL PROTECTED]
  
  Revision  Changes    Path
  1.4       +3 -1      
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/IntrospectionUtils.java
  
  Index: IntrospectionUtils.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/IntrospectionUtils.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- IntrospectionUtils.java   10 May 2002 23:32:14 -0000      1.3
  +++ IntrospectionUtils.java   17 May 2002 02:32:12 -0000      1.4
  @@ -187,7 +187,9 @@
                try {
                       if( "".equals(home) ) {
                           home=new File("./").getCanonicalPath();
  -                    }
  +                    } else if( home.endsWith(File.separator) ) {
  +                     home = home.substring(0,home.length()-1);
  +                 }
                       File f=new File( home );
                    String parentDir = f.getParent();
                    if(parentDir == null)
  
  
  

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

Reply via email to