View Javadoc

1   package org.apache.maven.plugin.testing.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 java.util.Collections;
23  import java.util.List;
24  
25  import org.apache.maven.artifact.Artifact;
26  import org.apache.maven.artifact.metadata.ArtifactMetadata;
27  import org.apache.maven.artifact.repository.ArtifactRepository;
28  import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
29  import org.apache.maven.artifact.repository.Authentication;
30  import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
31  import org.apache.maven.repository.Proxy;
32  
33  /**
34   * @author <a href="mailto:brianf@apache.org">Brian Fox</a>
35   * @version $Id: StubArtifactRepository.java 816911 2009-09-19 12:55:30Z olamy $
36   */
37  public class StubArtifactRepository
38      implements ArtifactRepository
39  {
40      private String baseDir = null;
41  
42      /**
43       * Default constructor
44       *
45       * @param dir the basedir
46       */
47      public StubArtifactRepository( String dir )
48      {
49          baseDir = dir;
50      }
51  
52      /**
53       * @return the <code>artifactId</code>.
54       * @see org.apache.maven.artifact.repository.ArtifactRepository#pathOf(org.apache.maven.artifact.Artifact)
55       */
56      public String pathOf( Artifact artifact )
57      {
58          return artifact.getId();
59      }
60  
61      /**
62       * @return <code>null</code>.
63       * @see org.apache.maven.artifact.repository.ArtifactRepository#pathOfRemoteRepositoryMetadata(org.apache.maven.artifact.metadata.ArtifactMetadata)
64       */
65      public String pathOfRemoteRepositoryMetadata( ArtifactMetadata artifactMetadata )
66      {
67          return null;
68      }
69  
70      /**
71       * @return the filename of this metadata on the local repository.
72       * @see org.apache.maven.artifact.repository.ArtifactRepository#pathOfLocalRepositoryMetadata(org.apache.maven.artifact.metadata.ArtifactMetadata, org.apache.maven.artifact.repository.ArtifactRepository)
73       */
74      public String pathOfLocalRepositoryMetadata( ArtifactMetadata metadata, ArtifactRepository repository )
75      {
76          return metadata.getLocalFilename( repository );
77      }
78  
79      /**
80       * @return <code>null</code>.
81       * @see org.apache.maven.artifact.repository.ArtifactRepository#getUrl()
82       */
83      public String getUrl()
84      {
85          return null;
86      }
87  
88      /**
89       * @return <code>basedir</code>.
90       * @see org.apache.maven.artifact.repository.ArtifactRepository#getBasedir()
91       */
92      public String getBasedir()
93      {
94          return baseDir;
95      }
96  
97      /**
98       * @return <code>null</code>.
99       * @see org.apache.maven.artifact.repository.ArtifactRepository#getProtocol()
100      */
101     public String getProtocol()
102     {
103         return null;
104     }
105 
106     /**
107      * @return <code>null</code>.
108      * @see org.apache.maven.artifact.repository.ArtifactRepository#getId()
109      */
110     public String getId()
111     {
112         return null;
113     }
114 
115     /**
116      * @return <code>null</code>.
117      * @see org.apache.maven.artifact.repository.ArtifactRepository#getSnapshots()
118      */
119     public ArtifactRepositoryPolicy getSnapshots()
120     {
121         return null;
122     }
123 
124     /**
125      * @return <code>null</code>.
126      * @see org.apache.maven.artifact.repository.ArtifactRepository#getReleases()
127      */
128     public ArtifactRepositoryPolicy getReleases()
129     {
130         return null;
131     }
132 
133     /**
134      * @return <code>null</code>.
135      * @see org.apache.maven.artifact.repository.ArtifactRepository#getLayout()
136      */
137     public ArtifactRepositoryLayout getLayout()
138     {
139         return null;
140     }
141 
142     /**
143      * @return <code>null</code>.
144      * @see org.apache.maven.artifact.repository.ArtifactRepository#getKey()
145      */
146     public String getKey()
147     {
148         return null;
149     }
150 
151     /**
152      * @return <code>false</code>.
153      * @see org.apache.maven.artifact.repository.ArtifactRepository#isUniqueVersion()
154      */
155     public boolean isUniqueVersion()
156     {
157         return false;
158     }
159 
160     /**
161      * By default, do nothing.
162      *
163      * @see org.apache.maven.artifact.repository.ArtifactRepository#setBlacklisted(boolean)
164      */
165     public void setBlacklisted( boolean blackListed )
166     {
167         // nop
168     }
169 
170     /**
171      * @return <code>false</code>.
172      * @see org.apache.maven.artifact.repository.ArtifactRepository#isBlacklisted()
173      */
174     public boolean isBlacklisted()
175     {
176         return false;
177     }
178 
179     public Artifact find( Artifact artifact )
180     {
181         // TODO Auto-generated method stub
182         return null;
183     }
184 
185     public Authentication getAuthentication()
186     {
187         return null;
188     }
189 
190     public Proxy getProxy()
191     {
192         return null;
193     }
194 
195     public void setAuthentication( Authentication authentication )
196     {
197        
198     }
199 
200     public void setId( String id )
201     {
202         
203     }
204 
205     public void setLayout( ArtifactRepositoryLayout layout )
206     {
207         
208     }
209 
210     public void setProxy( Proxy proxy )
211     {
212         
213     }
214 
215     public void setReleaseUpdatePolicy( ArtifactRepositoryPolicy policy )
216     {
217         
218     }
219 
220     public void setSnapshotUpdatePolicy( ArtifactRepositoryPolicy policy )
221     {
222         
223     }
224 
225     public void setUrl( String url )
226     {
227         
228     }
229 
230     public List<String> findVersions( Artifact artifact )
231     {
232         return Collections.emptyList();
233     }
234 
235 }