maven-wagon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mic...@apache.org
Subject cvs commit: maven-wagon/wagon-api/src/main/java/org/apache/maven/wagon/observers Md5SumObserver.java
Date Thu, 20 May 2004 16:00:58 GMT
michal      2004/05/20 09:00:58

  Modified:    wagon-api/src/main/java/org/apache/maven/wagon/observers
                        Md5SumObserver.java
  Log:
  added writeToFile method
  
  Revision  Changes    Path
  1.4       +27 -1     maven-wagon/wagon-api/src/main/java/org/apache/maven/wagon/observers/Md5SumObserver.java
  
  Index: Md5SumObserver.java
  ===================================================================
  RCS file: /home/cvs/maven-wagon/wagon-api/src/main/java/org/apache/maven/wagon/observers/Md5SumObserver.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Md5SumObserver.java	20 May 2004 15:41:37 -0000	1.3
  +++ Md5SumObserver.java	20 May 2004 16:00:57 -0000	1.4
  @@ -1,5 +1,6 @@
   package org.apache.maven.wagon.observers;
   
  +import java.io.File;
   import java.io.InputStream;
   import java.security.MessageDigest;
   import java.security.NoSuchAlgorithmException;
  @@ -8,6 +9,7 @@
   import org.apache.maven.wagon.WagonUtils;
   import org.apache.maven.wagon.events.TransferEvent;
   import org.apache.maven.wagon.events.TransferListener;
  +import org.codehaus.plexus.util.FileUtils;
   import org.codehaus.plexus.util.IOUtil;
   
   
  @@ -186,6 +188,30 @@
           }
           
           return retValue;
  +    }
  +
  +    /**
  +     * @param file
  +     */
  +    public void writeToFile( File file )
  +    {
  +        // Here I will write to file the expected md5 sum
  +        //(the one which was donloaded from the server)
  +        if ( expectedMd5 != null )
  +        {
  +            String path = file.getPath();
  +            
  +            try
  +            {                
  +                FileUtils.fileWrite( path , expectedMd5  );
  +            }
  +            catch( Exception e)
  +            {
  +               //getLogger().error( "Could not write the value of md5 checkum to file:
" + path );
  +               
  +            }
  +        }
  +        
       }
       
       
  
  
  

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