ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hi...@apache.org
Subject svn commit: r1069157 - in /ant/ivy/core/trunk/src/java/org/apache/ivy/core/retrieve: RetrieveEngine.java RetrieveReport.java
Date Wed, 09 Feb 2011 22:50:49 GMT
Author: hibou
Date: Wed Feb  9 22:50:48 2011
New Revision: 1069157

URL: http://svn.apache.org/viewvc?rev=1069157&view=rev
Log:
In the retrieve report, also add the mapping between the artifact and the file

Modified:
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/retrieve/RetrieveEngine.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/retrieve/RetrieveReport.java

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/retrieve/RetrieveEngine.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/retrieve/RetrieveEngine.java?rev=1069157&r1=1069156&r2=1069157&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/retrieve/RetrieveEngine.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/retrieve/RetrieveEngine.java Wed Feb 
9 22:50:48 2011
@@ -152,10 +152,10 @@ public class RetrieveEngine {
                                 new EndRetrieveArtifactEvent(artifact, destFile));
                         }
                         totalCopiedSize += destFile.length();
-                        report.addCopiedFile(destFile);
+                        report.addCopiedFile(destFile, artifact);
                     } else {
                         Message.verbose("\t\tto " + destFile + " [NOT REQUIRED]");
-                        report.addUpToDateFile(destFile);
+                        report.addUpToDateFile(destFile, artifact);
                     }
 
                     if ("ivy".equals(artifact.getType())) {

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/retrieve/RetrieveReport.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/retrieve/RetrieveReport.java?rev=1069157&r1=1069156&r2=1069157&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/retrieve/RetrieveReport.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/retrieve/RetrieveReport.java Wed Feb 
9 22:50:48 2011
@@ -20,12 +20,17 @@ package org.apache.ivy.core.retrieve;
 import java.io.File;
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.HashMap;
 import java.util.HashSet;
+import java.util.Map;
+
+import org.apache.ivy.core.report.ArtifactDownloadReport;
 
 public class RetrieveReport {
 
     private Collection/*<File>*/ upToDateFiles = new HashSet();
     private Collection/*<File>*/ copiedFiles = new HashSet();
+    private Map/*<File, ArtifactDownloadReport>*/ downloadReport = new HashMap();
 
     private File retrieveRoot;
 
@@ -48,12 +53,14 @@ public class RetrieveReport {
         return upToDateFiles.size();
     }
 
-    public void addCopiedFile(File file) {
+    public void addCopiedFile(File file, ArtifactDownloadReport report) {
         copiedFiles.add(file);
+        downloadReport.put(file, report);
     }
 
-    public void addUpToDateFile(File file) {
+    public void addUpToDateFile(File file, ArtifactDownloadReport report) {
         upToDateFiles.add(file);
+        downloadReport.put(file, report);
     }
 
     /**
@@ -81,4 +88,10 @@ public class RetrieveReport {
         return result;
     }
 
+    /**
+     * Get the mapping between the copied files and their corresponding download report
+     */
+    public Map getDownloadReport() {
+        return downloadReport;
+    }
 }



Mime
View raw message