]> source.dussan.org Git - archiva.git/blob
7f081c955902bdd113b5cc126e989b7b05ae438d
[archiva.git] /
1 /**
2  * 
3  */
4 package org.apache.maven.archiva.discoverer;
5
6 import org.apache.maven.archiva.common.consumers.Consumer;
7 import org.apache.maven.archiva.common.consumers.ConsumerException;
8 import org.apache.maven.archiva.common.utils.BaseFile;
9 import org.apache.maven.artifact.repository.ArtifactRepository;
10
11 import java.util.ArrayList;
12 import java.util.List;
13
14 public class MockConsumer
15     implements Consumer
16 {
17     private List excludePatterns = new ArrayList();
18
19     private List includePatterns = new ArrayList();
20
21     private List filesProcessed = new ArrayList();
22
23     private int countFileProblems = 0;
24
25     public String getName()
26     {
27         return "MockConsumer (Testing Only)";
28     }
29
30     public boolean init( ArtifactRepository repository )
31     {
32         return true;
33     }
34
35     public void processFile( BaseFile file )
36         throws ConsumerException
37     {
38         filesProcessed.add( file );
39     }
40
41     public void processFileProblem( BaseFile file, String message )
42     {
43         countFileProblems++;
44     }
45
46     public List getExcludePatterns()
47     {
48         return excludePatterns;
49     }
50
51     public void setExcludePatterns( List excludePatterns )
52     {
53         this.excludePatterns = excludePatterns;
54     }
55
56     public List getIncludePatterns()
57     {
58         return includePatterns;
59     }
60
61     public void setIncludePatterns( List includePatterns )
62     {
63         this.includePatterns = includePatterns;
64     }
65
66     public int getCountFileProblems()
67     {
68         return countFileProblems;
69     }
70
71     public List getFilesProcessed()
72     {
73         return filesProcessed;
74     }
75 }