archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r645761 - /archiva/trunk/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/src/main/java/org/apache/archiva/consumers/dependencytree/DependencyTreeGeneratorConsumer.java
Date Tue, 08 Apr 2008 04:34:59 GMT
Author: brett
Date: Mon Apr  7 21:34:36 2008
New Revision: 645761

URL: http://svn.apache.org/viewvc?rev=645761&view=rev
Log:
guard against incorrect generation

Modified:
    archiva/trunk/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/src/main/java/org/apache/archiva/consumers/dependencytree/DependencyTreeGeneratorConsumer.java

Modified: archiva/trunk/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/src/main/java/org/apache/archiva/consumers/dependencytree/DependencyTreeGeneratorConsumer.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/src/main/java/org/apache/archiva/consumers/dependencytree/DependencyTreeGeneratorConsumer.java?rev=645761&r1=645760&r2=645761&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/src/main/java/org/apache/archiva/consumers/dependencytree/DependencyTreeGeneratorConsumer.java
(original)
+++ archiva/trunk/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/src/main/java/org/apache/archiva/consumers/dependencytree/DependencyTreeGeneratorConsumer.java
Mon Apr  7 21:34:36 2008
@@ -103,6 +103,8 @@
 
     private Field processedProjectCacheField;
 
+    private List<String> includes = Collections.singletonList( "**/*.pom" );
+
     public String getDescription()
     {
         return "Generate dependency tree metadata for tracking changes across algorithms";
@@ -163,7 +165,7 @@
 
     public List getIncludes()
     {
-        return Collections.singletonList( "**/*.pom" );
+        return includes;
     }
 
     public void processFile( String path )
@@ -220,7 +222,13 @@
                 artifactFactory.createProjectArtifact( project.getGroupId(), project.getArtifactId(),
                                                        project.getVersion() );
 
-            File generatedFile = new File( generatedRepositoryLocation, layout.pathOf( artifact
) + ".xml" );
+            String p = layout.pathOf( artifact );
+            if ( !p.equals( path ) )
+            {
+                throw new ConsumerException( "Bad path: " + p + "; should be: " + path );
+            }
+
+            File generatedFile = new File( generatedRepositoryLocation, p + ".xml" );
             generatedFile.getParentFile().mkdirs();
             writer = new FileWriter( generatedFile );
             OutputFormat format = OutputFormat.createPrettyPrint();
@@ -314,5 +322,10 @@
 
             return true;
         }
+    }
+
+    public void setIncludes( List<String> includes )
+    {
+        this.includes = includes;
     }
 }



Mime
View raw message