maven-wagon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject cvs commit: maven-wagon/wagon-providers/wagon-http/src/main/java/org/apache/maven/wagon/providers/http PutInputStream.java
Date Tue, 08 Mar 2005 18:41:30 GMT
brett       2005/03/08 10:41:30

  Modified:    wagon-provider-api/src/main/java/org/apache/maven/wagon/observers
                        ChecksumObserver.java
               wagon-providers/wagon-http/src/main/java/org/apache/maven/wagon/providers/http
                        PutInputStream.java
  Log:
  fix some of the dodgy error handling
  
  Revision  Changes    Path
  1.8       +5 -8      maven-wagon/wagon-provider-api/src/main/java/org/apache/maven/wagon/observers/ChecksumObserver.java
  
  Index: ChecksumObserver.java
  ===================================================================
  RCS file: /home/cvs/maven-wagon/wagon-provider-api/src/main/java/org/apache/maven/wagon/observers/ChecksumObserver.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ChecksumObserver.java	15 Dec 2004 11:29:46 -0000	1.7
  +++ ChecksumObserver.java	8 Mar 2005 18:41:29 -0000	1.8
  @@ -19,10 +19,10 @@
   
   import org.apache.maven.wagon.Wagon;
   import org.apache.maven.wagon.WagonUtils;
  -import org.apache.maven.wagon.util.FileUtils;
  -import org.apache.maven.wagon.util.IoUtils;
   import org.apache.maven.wagon.events.TransferEvent;
   import org.apache.maven.wagon.events.TransferListener;
  +import org.apache.maven.wagon.util.FileUtils;
  +import org.apache.maven.wagon.util.IoUtils;
   
   import java.io.File;
   import java.io.InputStream;
  @@ -176,11 +176,8 @@
           }    
           finally
           {
  -            if ( inputStream != null )
  -            {
  -                 IoUtils.close( inputStream );
  -            }            
  -            
  +            IoUtils.close( inputStream );
  +
               transferingMd5 = false;
           }
           
  
  
  
  1.4       +9 -7      maven-wagon/wagon-providers/wagon-http/src/main/java/org/apache/maven/wagon/providers/http/PutInputStream.java
  
  Index: PutInputStream.java
  ===================================================================
  RCS file: /home/cvs/maven-wagon/wagon-providers/wagon-http/src/main/java/org/apache/maven/wagon/providers/http/PutInputStream.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- PutInputStream.java	14 Dec 2004 20:10:39 -0000	1.3
  +++ PutInputStream.java	8 Mar 2005 18:41:30 -0000	1.4
  @@ -17,13 +17,13 @@
    * ====================================================================
    */
   
  -import org.apache.maven.wagon.events.TransferEventSupport;
  -import org.apache.maven.wagon.events.TransferEvent;
   import org.apache.maven.wagon.Wagon;
  +import org.apache.maven.wagon.events.TransferEvent;
  +import org.apache.maven.wagon.events.TransferEventSupport;
   import org.apache.maven.wagon.resource.Resource;
   
  -import java.io.FileInputStream;
   import java.io.File;
  +import java.io.FileInputStream;
   import java.io.FileNotFoundException;
   import java.io.IOException;
   
  @@ -73,10 +73,12 @@
       {
           int retValue = super.read(b, off, len);
   
  -        event.setTimestamp( System.currentTimeMillis() );
  -
  -        eventSupport.fireTransferProgress( event, b, retValue );
  +        if ( retValue > 0 )
  +        {
  +            event.setTimestamp( System.currentTimeMillis() );
   
  +            eventSupport.fireTransferProgress( event, b, retValue );
  +        }
           return retValue;
       }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: wagon-cvs-unsubscribe@maven.apache.org
For additional commands, e-mail: wagon-cvs-help@maven.apache.org


Mime
View raw message