1 package org.apache.maven.plugin.assembly.archive.phase.wrappers;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import org.apache.maven.plugin.assembly.model.GroupVersionAlignment;
23 import org.apache.maven.plugin.assembly.model.Repository;
24 import org.apache.maven.shared.repository.model.RepositoryInfo;
25
26 import java.util.ArrayList;
27 import java.util.Iterator;
28 import java.util.List;
29
30
31
32
33 public class RepoInfoWrapper
34 implements RepositoryInfo
35 {
36
37 private final Repository repo;
38
39 private List<GroupVersionAlignmentWrapper> convertedAlignments;
40
41 public RepoInfoWrapper( final Repository repo )
42 {
43 this.repo = repo;
44 }
45
46 public List<String> getExcludes()
47 {
48 return repo.getExcludes();
49 }
50
51 public List<GroupVersionAlignmentWrapper> getGroupVersionAlignments()
52 {
53 final List<GroupVersionAlignment> alignments = repo.getGroupVersionAlignments();
54
55 if ( convertedAlignments == null || alignments.size() != convertedAlignments.size() )
56 {
57 final List<GroupVersionAlignmentWrapper> l =
58 new ArrayList<GroupVersionAlignmentWrapper>( alignments.size() );
59
60 for ( final Iterator<GroupVersionAlignment> it = alignments.iterator(); it.hasNext(); )
61 {
62 final GroupVersionAlignment alignment = it.next();
63
64 l.add( new GroupVersionAlignmentWrapper( alignment ) );
65 }
66
67 convertedAlignments = l;
68 }
69
70 return convertedAlignments;
71 }
72
73 public List<String> getIncludes()
74 {
75 return repo.getIncludes();
76 }
77
78 public String getScope()
79 {
80 return repo.getScope();
81 }
82
83 public boolean isIncludeMetadata()
84 {
85 return repo.isIncludeMetadata();
86 }
87
88 }