ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maart...@apache.org
Subject svn commit: r721287 - /ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/RepositoryResolver.java
Date Thu, 27 Nov 2008 21:46:44 GMT
Author: maartenc
Date: Thu Nov 27 13:46:44 2008
New Revision: 721287

URL: http://svn.apache.org/viewvc?rev=721287&view=rev
Log:
IMPROVEMENT: Error message is not clear when specifying an invalid value for checksums (IVY-977)

Modified:
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/RepositoryResolver.java

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/RepositoryResolver.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/RepositoryResolver.java?rev=721287&r1=721286&r2=721287&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/RepositoryResolver.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/RepositoryResolver.java Thu
Nov 27 13:46:44 2008
@@ -216,9 +216,15 @@
 
     protected void put(Artifact artifact, File src, String dest, boolean overwrite)
             throws IOException {
-        repository.put(artifact, src, dest, overwrite);
+        // verify the checksum algorithms before uploading artifacts!
         String[] checksums = getChecksumAlgorithms();
         for (int i = 0; i < checksums.length; i++) {
+            if (!ChecksumHelper.isKnownAlgorithm(checksums[i])) {
+                throw new IllegalArgumentException("Unknown checksum algorithm: " + checksums[i]);
           }
+        }
+        
+        repository.put(artifact, src, dest, overwrite);
+        for (int i = 0; i < checksums.length; i++) {
             putChecksum(artifact, src, dest, overwrite, checksums[i]);
         }
     }



Mime
View raw message