maven-wagon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject cvs commit: maven-wagon/wagon-providers/http/src/main/java/org/apache/maven/wagon/providers/http HttpWagon.java
Date Wed, 28 Apr 2004 12:01:56 GMT
evenisse    2004/04/28 05:01:56

  Modified:    wagon-api/src/main/java/org/apache/maven/wagon
                        WagonTestCase.java
               wagon-api/src/main/java/org/apache/maven/wagon/manager
                        DefaultWagonManager.java
               wagon-providers/http/src/main/java/org/apache/maven/wagon/providers/http
                        HttpWagon.java
  Log:
  Delete all temp file on exit. It's necessary in some case on windows.
  
  Revision  Changes    Path
  1.4       +5 -1      maven-wagon/wagon-api/src/main/java/org/apache/maven/wagon/WagonTestCase.java
  
  Index: WagonTestCase.java
  ===================================================================
  RCS file: /home/cvs/maven-wagon/wagon-api/src/main/java/org/apache/maven/wagon/WagonTestCase.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- WagonTestCase.java	24 Apr 2004 17:38:26 -0000	1.3
  +++ WagonTestCase.java	28 Apr 2004 12:01:55 -0000	1.4
  @@ -211,6 +211,8 @@
   
           destFile = File.createTempFile( "wagon", ".tmp" );
   
  +        destFile.deleteOnExit();
  +
           wagon.get( resource, destFile );
   
           wagon.disconnect();
  @@ -264,6 +266,8 @@
           wagon.connect( testRepository );
   
           artifactDestFile = File.createTempFile( "wagon", ".tmp" );
  +
  +        artifactDestFile.deleteOnExit();
   
           wagon.get( getTestArtifact(), artifactDestFile );
   
  
  
  
  1.5       +3 -1      maven-wagon/wagon-api/src/main/java/org/apache/maven/wagon/manager/DefaultWagonManager.java
  
  Index: DefaultWagonManager.java
  ===================================================================
  RCS file: /home/cvs/maven-wagon/wagon-api/src/main/java/org/apache/maven/wagon/manager/DefaultWagonManager.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DefaultWagonManager.java	26 Apr 2004 19:23:43 -0000	1.4
  +++ DefaultWagonManager.java	28 Apr 2004 12:01:55 -0000	1.5
  @@ -148,6 +148,8 @@
           try        
           {
              temp = File.createTempFile( "wagon", "tmp" );
  +
  +           temp.deleteOnExit();
           }
           catch( Exception e)
           {
  
  
  
  1.5       +11 -5     maven-wagon/wagon-providers/http/src/main/java/org/apache/maven/wagon/providers/http/HttpWagon.java
  
  Index: HttpWagon.java
  ===================================================================
  RCS file: /home/cvs/maven-wagon/wagon-providers/http/src/main/java/org/apache/maven/wagon/providers/http/HttpWagon.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- HttpWagon.java	24 Apr 2004 17:38:44 -0000	1.4
  +++ HttpWagon.java	28 Apr 2004 12:01:56 -0000	1.5
  @@ -265,19 +265,25 @@
                                                      + statusCode );
           }
   
  +        OutputStream os = null;
  +
  +        InputStream is = null;
  +
           try
           {
  -            OutputStream os = new FileOutputStream( destination );
  +            os = new FileOutputStream( destination );
   
  -            InputStream is = getMethod.getResponseBodyAsStream();
  +            is = getMethod.getResponseBodyAsStream();
   
               getTransfer( resource, is, os );
  -
  -            closeTransferStreams( is, os );
           }
           catch ( Exception e )
           {
               throw new TransferFailedException( "Cannot transfer!", e );
  +        }
  +        finally
  +        {
  +            closeTransferStreams( is, os );
           }
   
           getMethod.releaseConnection();
  
  
  

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