tomj        02/04/22 14:32:35

  Modified:    java/samples/attachments EchoAttachment.java
  Log:
  Grab some (really) low hanging fruit...
  
  Fix bug 7560: echoAttachment does slow file compare.
  Check the lengths of the files before comparing them.
  
  Revision  Changes    Path
  1.12      +7 -0      xml-axis/java/samples/attachments/EchoAttachment.java
  
  Index: EchoAttachment.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/samples/attachments/EchoAttachment.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- EchoAttachment.java       19 Apr 2002 18:42:30 -0000      1.11
  +++ EchoAttachment.java       22 Apr 2002 21:32:35 -0000      1.12
  @@ -69,6 +69,7 @@
   import javax.xml.rpc.namespace.QName;
   
   import java.net.URL;
  +import java.io.File;
   
   
   /**
  @@ -349,6 +350,12 @@
   
           java.io.BufferedInputStream oneStream = null;
           java.io.BufferedInputStream otherStream = null;
  +        
  +        // First compare file length.
  +        File f1 = new File(one);
  +        File f2 = new File(other);
  +        if (f1.length() != f2.length())
  +            return false;
   
           try {
               oneStream = new java.io.BufferedInputStream(
  
  
  


Reply via email to