org.apache.maven.artifact.repository
Class MavenArtifactRepository

java.lang.Object
  extended by org.apache.maven.artifact.repository.MavenArtifactRepository
All Implemented Interfaces:
ArtifactRepository
Direct Known Subclasses:
DelegatingLocalArtifactRepository, LocalArtifactRepository

public class MavenArtifactRepository
extends Object
implements ArtifactRepository


Constructor Summary
MavenArtifactRepository()
           
MavenArtifactRepository(String id, String url, ArtifactRepositoryLayout layout, ArtifactRepositoryPolicy snapshots, ArtifactRepositoryPolicy releases)
          Create a remote download repository.
 
Method Summary
protected static
<T> boolean
eq(T s1, T s2)
           
 boolean equals(Object obj)
           
 Artifact find(Artifact artifact)
           
 List<String> findVersions(Artifact artifact)
          Finds the versions of the specified artifact that are available in this repository.
 Authentication getAuthentication()
           
 String getBasedir()
           
 String getId()
           
 String getKey()
           
 ArtifactRepositoryLayout getLayout()
           
 List<ArtifactRepository> getMirroredRepositories()
           
 String getProtocol()
           
 Proxy getProxy()
           
 ArtifactRepositoryPolicy getReleases()
           
 ArtifactRepositoryPolicy getSnapshots()
           
 String getUrl()
           
 int hashCode()
           
 boolean isBlacklisted()
           
 boolean isProjectAware()
          Indicates whether this repository is backed by actual projects.
 boolean isUniqueVersion()
           
 String pathOf(Artifact artifact)
           
 String pathOfLocalRepositoryMetadata(ArtifactMetadata metadata, ArtifactRepository repository)
           
 String pathOfRemoteRepositoryMetadata(ArtifactMetadata artifactMetadata)
           
 void setAuthentication(Authentication authentication)
           
 void setBlacklisted(boolean blackListed)
           
 void setId(String id)
           
 void setLayout(ArtifactRepositoryLayout layout)
           
 void setMirroredRepositories(List<ArtifactRepository> mirroredRepositories)
           
 void setProxy(Proxy proxy)
           
 void setReleaseUpdatePolicy(ArtifactRepositoryPolicy releases)
           
 void setSnapshotUpdatePolicy(ArtifactRepositoryPolicy snapshots)
           
 void setUrl(String url)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MavenArtifactRepository

public MavenArtifactRepository()

MavenArtifactRepository

public MavenArtifactRepository(String id,
                               String url,
                               ArtifactRepositoryLayout layout,
                               ArtifactRepositoryPolicy snapshots,
                               ArtifactRepositoryPolicy releases)
Create a remote download repository.

Parameters:
id - the unique identifier of the repository
url - the URL of the repository
layout - the layout of the repository
snapshots - the policies to use for snapshots
releases - the policies to use for releases
Method Detail

pathOf

public String pathOf(Artifact artifact)
Specified by:
pathOf in interface ArtifactRepository

pathOfRemoteRepositoryMetadata

public String pathOfRemoteRepositoryMetadata(ArtifactMetadata artifactMetadata)
Specified by:
pathOfRemoteRepositoryMetadata in interface ArtifactRepository

pathOfLocalRepositoryMetadata

public String pathOfLocalRepositoryMetadata(ArtifactMetadata metadata,
                                            ArtifactRepository repository)
Specified by:
pathOfLocalRepositoryMetadata in interface ArtifactRepository

setLayout

public void setLayout(ArtifactRepositoryLayout layout)
Specified by:
setLayout in interface ArtifactRepository

getLayout

public ArtifactRepositoryLayout getLayout()
Specified by:
getLayout in interface ArtifactRepository

setSnapshotUpdatePolicy

public void setSnapshotUpdatePolicy(ArtifactRepositoryPolicy snapshots)
Specified by:
setSnapshotUpdatePolicy in interface ArtifactRepository

getSnapshots

public ArtifactRepositoryPolicy getSnapshots()
Specified by:
getSnapshots in interface ArtifactRepository

setReleaseUpdatePolicy

public void setReleaseUpdatePolicy(ArtifactRepositoryPolicy releases)
Specified by:
setReleaseUpdatePolicy in interface ArtifactRepository

getReleases

public ArtifactRepositoryPolicy getReleases()
Specified by:
getReleases in interface ArtifactRepository

getKey

public String getKey()
Specified by:
getKey in interface ArtifactRepository

toString

public String toString()
Overrides:
toString in class Object

find

public Artifact find(Artifact artifact)
Specified by:
find in interface ArtifactRepository

findVersions

public List<String> findVersions(Artifact artifact)
Description copied from interface: ArtifactRepository
Finds the versions of the specified artifact that are available in this repository.

Specified by:
findVersions in interface ArtifactRepository
Parameters:
artifact - The artifact whose available versions should be determined, must not be null.
Returns:
The available versions of the artifact or an empty list if none, never null.

getId

public String getId()
Specified by:
getId in interface ArtifactRepository

getUrl

public String getUrl()
Specified by:
getUrl in interface ArtifactRepository

getBasedir

public String getBasedir()
Specified by:
getBasedir in interface ArtifactRepository

getProtocol

public String getProtocol()
Specified by:
getProtocol in interface ArtifactRepository

setId

public void setId(String id)
Specified by:
setId in interface ArtifactRepository

setUrl

public void setUrl(String url)
Specified by:
setUrl in interface ArtifactRepository

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

eq

protected static <T> boolean eq(T s1,
                                T s2)

getAuthentication

public Authentication getAuthentication()
Specified by:
getAuthentication in interface ArtifactRepository

setAuthentication

public void setAuthentication(Authentication authentication)
Specified by:
setAuthentication in interface ArtifactRepository

getProxy

public Proxy getProxy()
Specified by:
getProxy in interface ArtifactRepository

setProxy

public void setProxy(Proxy proxy)
Specified by:
setProxy in interface ArtifactRepository

isBlacklisted

public boolean isBlacklisted()
Specified by:
isBlacklisted in interface ArtifactRepository

setBlacklisted

public void setBlacklisted(boolean blackListed)
Specified by:
setBlacklisted in interface ArtifactRepository

isUniqueVersion

public boolean isUniqueVersion()
Specified by:
isUniqueVersion in interface ArtifactRepository

isProjectAware

public boolean isProjectAware()
Description copied from interface: ArtifactRepository
Indicates whether this repository is backed by actual projects. For instance, the build reactor or IDE workspace are examples of such repositories.

Specified by:
isProjectAware in interface ArtifactRepository
Returns:
true if the repository is backed by actual projects, false otherwise.

getMirroredRepositories

public List<ArtifactRepository> getMirroredRepositories()
Specified by:
getMirroredRepositories in interface ArtifactRepository

setMirroredRepositories

public void setMirroredRepositories(List<ArtifactRepository> mirroredRepositories)
Specified by:
setMirroredRepositories in interface ArtifactRepository


Copyright © 2001-2013 The Apache Software Foundation. All Rights Reserved.