Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
LegacyArtifactPath |
|
| 1.0;1 |
1 | /* | |
2 | * $Id$ | |
3 | */ | |
4 | ||
5 | package org.apache.maven.archiva.configuration; | |
6 | ||
7 | //---------------------------------/ | |
8 | //- Imported classes and packages -/ | |
9 | //---------------------------------/ | |
10 | ||
11 | import java.util.Date; | |
12 | ||
13 | /** | |
14 | * Class LegacyArtifactPath. | |
15 | * | |
16 | * @version $Revision$ $Date$ | |
17 | */ | |
18 | 0 | public class LegacyArtifactPath |
19 | implements java.io.Serializable | |
20 | { | |
21 | ||
22 | //--------------------------/ | |
23 | //- Class/Member Variables -/ | |
24 | //--------------------------/ | |
25 | ||
26 | /** | |
27 | * | |
28 | * The legacy path. | |
29 | * | |
30 | */ | |
31 | private String path; | |
32 | ||
33 | /** | |
34 | * | |
35 | * The artifact reference, as " [groupId] : | |
36 | * [artifactId] : [version] : [classifier] : [type] ". | |
37 | * | |
38 | */ | |
39 | private String artifact; | |
40 | ||
41 | ||
42 | //-----------/ | |
43 | //- Methods -/ | |
44 | //-----------/ | |
45 | ||
46 | /** | |
47 | * Get | |
48 | * The artifact reference, as " [groupId] : | |
49 | * [artifactId] : [version] : [classifier] : [type] ". | |
50 | * | |
51 | * | |
52 | * @return String | |
53 | */ | |
54 | public String getArtifact() | |
55 | { | |
56 | 0 | return this.artifact; |
57 | } //-- String getArtifact() | |
58 | ||
59 | /** | |
60 | * Get | |
61 | * The legacy path. | |
62 | * | |
63 | * | |
64 | * @return String | |
65 | */ | |
66 | public String getPath() | |
67 | { | |
68 | 0 | return this.path; |
69 | } //-- String getPath() | |
70 | ||
71 | /** | |
72 | * Set | |
73 | * The artifact reference, as " [groupId] : | |
74 | * [artifactId] : [version] : [classifier] : [type] ". | |
75 | * | |
76 | * | |
77 | * @param artifact | |
78 | */ | |
79 | public void setArtifact( String artifact ) | |
80 | { | |
81 | 0 | this.artifact = artifact; |
82 | 0 | } //-- void setArtifact( String ) |
83 | ||
84 | /** | |
85 | * Set | |
86 | * The legacy path. | |
87 | * | |
88 | * | |
89 | * @param path | |
90 | */ | |
91 | public void setPath( String path ) | |
92 | { | |
93 | 0 | this.path = path; |
94 | 0 | } //-- void setPath( String ) |
95 | ||
96 | ||
97 | public boolean match( String path ) | |
98 | { | |
99 | 0 | return path.equals( this.path ); |
100 | } | |
101 | ||
102 | public String getGroupId() | |
103 | { | |
104 | 0 | return artifact.split( ":" )[0]; |
105 | } | |
106 | ||
107 | public String getArtifactId() | |
108 | { | |
109 | 0 | return artifact.split( ":" )[1]; |
110 | } | |
111 | ||
112 | public String getVersion() | |
113 | { | |
114 | 0 | return artifact.split( ":" )[2]; |
115 | } | |
116 | ||
117 | public String getClassifier() | |
118 | { | |
119 | 0 | String classifier = artifact.split( ":" )[3]; |
120 | 0 | return classifier.length() > 0 ? classifier : null; |
121 | } | |
122 | ||
123 | public String getType() | |
124 | { | |
125 | 0 | return artifact.split( ":" )[4]; |
126 | } | |
127 | ||
128 | } |