tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marcs...@apache.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/util FileUtil.java
Date Tue, 01 Jul 2003 21:02:14 GMT
marcsaeg    2003/07/01 14:02:14

  Modified:    src/share/org/apache/tomcat/util Tag: tomcat_32
                        FileUtil.java
  Log:
  Performance improvments.  Removed lots of calls to String.charAt() and
  repeated calls to System.getProperty() for properties that will never
  change.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.9.2.9   +8 -6      jakarta-tomcat/src/share/org/apache/tomcat/util/Attic/FileUtil.java
  
  Index: FileUtil.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/Attic/FileUtil.java,v
  retrieving revision 1.9.2.8
  retrieving revision 1.9.2.9
  diff -u -r1.9.2.8 -r1.9.2.9
  --- FileUtil.java	21 Mar 2001 22:23:06 -0000	1.9.2.8
  +++ FileUtil.java	1 Jul 2003 21:02:13 -0000	1.9.2.9
  @@ -84,6 +84,8 @@
   
   public class FileUtil {
   
  +    private static boolean isNetware = System.getProperty("os.name").startsWith("NetWare");
  +
       public static File[] listFiles(File dir) {
   
   	String[] ss = dir.list();
  @@ -244,7 +246,7 @@
   	    patchPath.charAt(1) == ':') {
   	    char[] ca = patchPath.replace('/', '\\').toCharArray();
   	    char c;
  -	    StringBuffer sb = new StringBuffer();
  +	    StringBuffer sb = new StringBuffer(ca.length);
   
   	    for (int i = 0; i < ca.length; i++) {
   		if ((ca[i] != '\\') ||
  @@ -268,7 +270,7 @@
   	}
   
   	// fix path on NetWare - all '/' become '\\' and remove duplicate '\\'
  -	if (System.getProperty("os.name").startsWith("NetWare") &&
  +	if (isNetware &&
   	    path.length() >=3 &&
   	    path.indexOf(':') > 0) {
               char ca[] = patchPath.replace('/', '\\').toCharArray();
  @@ -297,7 +299,7 @@
   	    return true;
   
   	// NetWare volume:
  -	if (System.getProperty("os.name").startsWith("NetWare") &&
  +	if (isNetware &&
   	    path.length() >=3 &&
   	    path.indexOf(':') > 0)
   	    return true;
  
  
  

---------------------------------------------------------------------
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