View Javadoc
1   package org.apache.maven.plugins.rar.stubs;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *  http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import org.apache.maven.artifact.handler.ArtifactHandler;
23  import org.apache.maven.artifact.versioning.VersionRange;
24  import org.apache.maven.plugin.testing.stubs.ArtifactStub;
25  
26  import java.io.File;
27  
28  /**
29   * @author <a href="mailto:aramirez@apache.org">Allan Ramirez</a>
30   */
31  public class RarArtifactStub
32      extends ArtifactStub
33  {
34      private String groupId;
35  
36      private String artifactId;
37  
38      private String version;
39  
40      private String scope;
41  
42      private boolean optional;
43  
44      private File file;
45  
46      public String getArtifactId()
47      {
48          return artifactId;
49      }
50  
51      public void setArtifactId( String artifactId )
52      {
53          this.artifactId = artifactId;
54      }
55  
56      public File getFile()
57      {
58          return file;
59      }
60  
61      public void setFile( File file )
62      {
63          this.file = file;
64      }
65  
66      public String getGroupId()
67      {
68          return groupId;
69      }
70  
71      public void setGroupId( String groupId )
72      {
73          this.groupId = groupId;
74      }
75  
76      public boolean isOptional()
77      {
78          return optional;
79      }
80  
81      public void setOptional( boolean optional )
82      {
83          this.optional = optional;
84      }
85  
86      public String getScope()
87      {
88          return scope;
89      }
90  
91      public void setScope( String scope )
92      {
93          this.scope = scope;
94      }
95  
96      public String getVersion()
97      {
98          return version;
99      }
100 
101     public void setVersion( String version )
102     {
103         this.version = version;
104     }
105 
106     public String getId()
107     {
108         return getGroupId() + ":" + getArtifactId() + ":" + getVersion();
109     }
110 
111     public String getBaseVersion()
112     {
113         return getVersion();
114     }
115 
116     public VersionRange getVersionRange()
117     {
118         return VersionRange.createFromVersion( this.version );
119     }
120 
121     public ArtifactHandler getArtifactHandler()
122     {
123         return new ArtifactHandler()
124         {
125 
126             public boolean isIncludesDependencies()
127             {
128                 return false;
129             }
130 
131             public boolean isAddedToClasspath()
132             {
133                 return true;
134             }
135 
136             public String getPackaging()
137             {
138                 return null;
139             }
140 
141             public String getLanguage()
142             {
143                 return null;
144             }
145 
146             public String getExtension()
147             {
148                 return null;
149             }
150 
151             public String getDirectory()
152             {
153                 return null;
154             }
155 
156             public String getClassifier()
157             {
158                 return null;
159             }
160         };
161     }
162 
163     public String getType()
164     {
165         return "rar";
166     }
167 
168 
169 }