tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@locus.apache.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/loader SimpleFileFilter.java
Date Mon, 14 Aug 2000 18:08:11 GMT
costin      00/08/14 11:08:10

  Modified:    src/share/org/apache/tomcat/loader SimpleFileFilter.java
  Log:
  Fix for JDK1.1 problem from Jim Rudnicki <jdr5list@pacbell.net>
  
  There is another patch from Jim ( regarding recycle() ), but I don't
  understand where should it be applyed ( it seems to be a real problem, but ContextManager
  changed and the diff doesn't have enough context - line numbers don't match ).
  
  Submitted by: Jim Rudnicki <jdr5list@pacbell.net>
  
  Revision  Changes    Path
  1.5       +13 -3     jakarta-tomcat/src/share/org/apache/tomcat/loader/SimpleFileFilter.java
  
  Index: SimpleFileFilter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/loader/SimpleFileFilter.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SimpleFileFilter.java	2000/07/27 18:47:35	1.4
  +++ SimpleFileFilter.java	2000/08/14 18:08:09	1.5
  @@ -64,7 +64,7 @@
    * interface.
    *
    * @author <a href="mailto:mjenning@islandnet.com">Mike Jennings</a>
  - * @version $Revision: 1.4 $
  + * @version $Revision: 1.5 $
    * @deprecated No longer used, AdaptiveClassLoader1 doesn't need it
    */
   public class SimpleFileFilter implements FilenameFilter {
  @@ -102,9 +102,19 @@
         */
         public static String[] fileOrFiles(File f) {
             if (f==null) return null;
  +
  +	  String[] files;
  +
  +	  /* directories return null for getName()
  +	     Test for these first */
  +	  if( f.isDirectory() ) {
  +	      files=new String[1];
  +	      files[0]=f.getPath();
  +	      return files;
  +	  }
  +	  String fname=f.getName();
             File parent=new File(f.getParent());
  -          String fname=f.getName();
  -          String[] files;
  +
             if (fname.charAt(0)=='*') {
                 String filter=fname.substring(1,fname.length());
                 files=parent.list(new SimpleFileFilter(filter));
  
  
  

Mime
View raw message