View Javadoc

1   package org.apache.maven.plugin.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      private ArtifactHandler artifactHandler;
47  
48      public String getArtifactId()
49      {
50          return artifactId;
51      }
52  
53      public void setArtifactId( String artifactId )
54      {
55          this.artifactId = artifactId;
56      }
57  
58      public File getFile()
59      {
60          return file;
61      }
62  
63      public void setFile( File file )
64      {
65          this.file = file;
66      }
67  
68      public String getGroupId()
69      {
70          return groupId;
71      }
72  
73      public void setGroupId( String groupId )
74      {
75          this.groupId = groupId;
76      }
77  
78      public boolean isOptional()
79      {
80          return optional;
81      }
82  
83      public void setOptional( boolean optional )
84      {
85          this.optional = optional;
86      }
87  
88      public String getScope()
89      {
90          return scope;
91      }
92  
93      public void setScope( String scope )
94      {
95          this.scope = scope;
96      }
97  
98      public String getVersion()
99      {
100         return version;
101     }
102 
103     public void setVersion( String version )
104     {
105         this.version = version;
106     }
107 
108     public String getId()
109     {
110         return getGroupId() + ":" + getArtifactId() + ":" + getVersion();
111     }
112 
113     public String getBaseVersion()
114     {
115         return getVersion();
116     }
117 
118     public VersionRange getVersionRange()
119     {
120         return VersionRange.createFromVersion( this.version );
121     }
122 
123     public ArtifactHandler getArtifactHandler()
124     {
125         return new ArtifactHandler()
126         {
127 
128             public boolean isIncludesDependencies()
129             {
130                 return false;
131             }
132 
133             public boolean isAddedToClasspath()
134             {
135                 return true;
136             }
137 
138             public String getPackaging()
139             {
140                 return null;
141             }
142 
143             public String getLanguage()
144             {
145                 return null;
146             }
147 
148             public String getExtension()
149             {
150                 return null;
151             }
152 
153             public String getDirectory()
154             {
155                 return null;
156             }
157 
158             public String getClassifier()
159             {
160                 return null;
161             }
162         };
163     }
164 
165     public String getType()
166     {
167         return "rar";
168     }
169 
170 
171 }