View Javadoc
1   /*
2    * REPOWEB, repository manager.
3    *
4    * Terms of license - http://opensource.org/licenses/apachepl.php
5    */
6   package org.repoweb.model;
7   import java.util.Collections;
8   import java.util.List;
9   import org.repoweb.pom.Project;
10  /***
11   * Mock an empty repository .
12   */
13  class FailSafeRepository implements Repository, GroupList {
14      public Group getGroup(String groupId) throws UnknownGroupIdException {
15          throw new UnknownGroupIdException(groupId);
16      }
17  
18  
19      public GroupList findGroups(String pattern) {
20          return this;
21      }
22  
23  
24      public ArtifactList findArtifacts(String groupId, String typeId, String filename) {
25          return null;
26      }
27  
28  
29      public ArtifactList findArtifactByClass(String fullClassName) {
30          return null;
31      }
32  
33  
34      public Artifact buildPom(Project project) throws BuildFailureException {
35          throw new BuildFailureException("Bad repository configuration !");
36      }
37  
38  
39      public Artifact getArtifact(String groupId, String typeId, String filename)
40          throws UnknownArtifactException {
41          throw new UnknownArtifactException();
42      }
43  
44  
45      public GroupList getAllGroups() {
46          return this;
47      }
48  
49  
50      public List getGroups() {
51          return Collections.EMPTY_LIST;
52      }
53  
54  
55      public Group getGroup(int idx) {
56          return null;
57      }
58  
59  
60      public int getGroupCount() {
61          return 0;
62      }
63  }