costin 01/09/19 20:46:32
Modified: src/share/org/apache/tomcat/util IntrospectionUtils.java
Log:
Another TODO item for 3.3
Added support for a classes-like dir. To avoid mess, we're not adding common, apps,
container to the classpath - but a classes/ subdir.
In addition added checks for null before adding the jars/dirs.
Revision Changes Path
1.15 +10 -2
jakarta-tomcat/src/share/org/apache/tomcat/util/IntrospectionUtils.java
Index: IntrospectionUtils.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/IntrospectionUtils.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- IntrospectionUtils.java 2001/09/09 21:53:26 1.14
+++ IntrospectionUtils.java 2001/09/20 03:46:32 1.15
@@ -458,7 +458,9 @@
if (cpComp != null){
int jarCount=cpComp.length;
for( int i=0; i< jarCount ; i++ ) {
- cpV.addElement( getURL( dir , cpComp[i] ));
+ URL url=getURL( dir , cpComp[i] );
+ if( url!=null )
+ cpV.addElement( url );
}
}
}catch(Exception ex){
@@ -509,6 +511,7 @@
if( f.isDirectory() ){
path +="/";
}
+ if( ! f.exists() ) return null;
return new URL( "file", "", path );
} catch (Exception ex) {
ex.printStackTrace();
@@ -564,8 +567,13 @@
throws IOException, MalformedURLException
{
Vector jarsV = new Vector();
- if( dir!=null )
+ if( dir!=null ) {
addToClassPath( jarsV, dir );
+ // Add dir/classes, if it exists
+ URL url=getURL( dir, "classes");
+ if( url!=null )
+ jarsV.addElement(url);
+ }
if( cpath != null )
addJarsFromClassPath(jarsV,cpath);