View Javadoc

1   package org.apache.maven.artifact.ant;
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  /**
23   * Remote repository type.
24   *
25   * @author <a href="mailto:brett@apache.org">Brett Porter</a>
26   * @version $Id: RemoteRepository.html 806929 2012-03-01 18:57:40Z hboutemy $
27   */
28  public class RemoteRepository
29      extends Repository
30  {
31      private String url;
32  
33      private Authentication authentication;
34  
35      private Proxy proxy;
36  
37      private RepositoryPolicy snapshots;
38  
39      private RepositoryPolicy releases;
40  
41      public String getUrl()
42      {
43          return ( (RemoteRepository) getInstance() ).url;
44      }
45  
46      public void setUrl( String url )
47      {
48          this.url = url;
49      }
50  
51      public Authentication getAuthentication()
52      {
53          return ( (RemoteRepository) getInstance() ).authentication;
54      }
55  
56      public void addAuthentication( Authentication authentication )
57      {
58          this.authentication = authentication;
59      }
60  
61      public void addProxy( Proxy proxy )
62      {
63          this.proxy = proxy;
64      }
65  
66      public Proxy getProxy()
67      {
68          return ( (RemoteRepository) getInstance() ).proxy;
69      }
70  
71      public RepositoryPolicy getSnapshots()
72      {
73          return ( (RemoteRepository) getInstance() ).snapshots;
74      }
75  
76      public void addSnapshots( RepositoryPolicy snapshots )
77      {
78          this.snapshots = snapshots;
79      }
80  
81      public RepositoryPolicy getReleases()
82      {
83          return ( (RemoteRepository) getInstance() ).releases;
84      }
85  
86      public void addReleases( RepositoryPolicy releases )
87      {
88          this.releases = releases;
89      }
90  
91      protected String getDefaultId()
92      {
93          return getUrl();
94      }
95  
96  }