public class MavenArtifactRepository extends java.lang.Object implements ArtifactRepository
Modifier and Type | Field and Description |
---|---|
private Authentication |
authentication |
private java.lang.String |
basedir |
private java.lang.String |
id |
private ArtifactRepositoryLayout |
layout |
private java.util.List<ArtifactRepository> |
mirroredRepositories |
private java.lang.String |
protocol |
private Proxy |
proxy |
private ArtifactRepositoryPolicy |
releases |
private ArtifactRepositoryPolicy |
snapshots |
private java.lang.String |
url |
Constructor and Description |
---|
MavenArtifactRepository() |
MavenArtifactRepository(java.lang.String id,
java.lang.String url,
ArtifactRepositoryLayout layout,
ArtifactRepositoryPolicy snapshots,
ArtifactRepositoryPolicy releases)
Create a remote download repository.
|
Modifier and Type | Method and Description |
---|---|
private java.lang.String |
basedir(java.lang.String url)
Derive the path portion of the given URL.
|
private static java.lang.String |
decode(java.lang.String url)
Decodes the specified (portion of a) URL.
|
protected static <T> boolean |
eq(T s1,
T s2) |
boolean |
equals(java.lang.Object obj) |
Artifact |
find(Artifact artifact) |
java.util.List<java.lang.String> |
findVersions(Artifact artifact)
Finds the versions of the specified artifact that are available in this repository.
|
Authentication |
getAuthentication() |
java.lang.String |
getBasedir() |
java.lang.String |
getId() |
java.lang.String |
getKey() |
ArtifactRepositoryLayout |
getLayout() |
java.util.List<ArtifactRepository> |
getMirroredRepositories() |
java.lang.String |
getProtocol() |
Proxy |
getProxy() |
ArtifactRepositoryPolicy |
getReleases() |
ArtifactRepositoryPolicy |
getSnapshots() |
java.lang.String |
getUrl() |
int |
hashCode() |
boolean |
isBlacklisted() |
boolean |
isProjectAware()
Indicates whether this repository is backed by actual projects.
|
boolean |
isUniqueVersion() |
java.lang.String |
pathOf(Artifact artifact) |
java.lang.String |
pathOfLocalRepositoryMetadata(ArtifactMetadata metadata,
ArtifactRepository repository) |
java.lang.String |
pathOfRemoteRepositoryMetadata(ArtifactMetadata artifactMetadata) |
private static java.lang.String |
protocol(java.lang.String url)
Return the protocol name.
|
void |
setAuthentication(Authentication authentication) |
void |
setBlacklisted(boolean blackListed) |
void |
setId(java.lang.String id) |
void |
setLayout(ArtifactRepositoryLayout layout) |
void |
setMirroredRepositories(java.util.List<ArtifactRepository> mirroredRepositories) |
void |
setProxy(Proxy proxy) |
void |
setReleaseUpdatePolicy(ArtifactRepositoryPolicy releases) |
void |
setSnapshotUpdatePolicy(ArtifactRepositoryPolicy snapshots) |
void |
setUrl(java.lang.String url) |
java.lang.String |
toString() |
private java.lang.String id
private java.lang.String url
private java.lang.String basedir
private java.lang.String protocol
private ArtifactRepositoryLayout layout
private ArtifactRepositoryPolicy snapshots
private ArtifactRepositoryPolicy releases
private Authentication authentication
private Proxy proxy
private java.util.List<ArtifactRepository> mirroredRepositories
public MavenArtifactRepository()
public MavenArtifactRepository(java.lang.String id, java.lang.String url, ArtifactRepositoryLayout layout, ArtifactRepositoryPolicy snapshots, ArtifactRepositoryPolicy releases)
id
- the unique identifier of the repositoryurl
- the URL of the repositorylayout
- the layout of the repositorysnapshots
- the policies to use for snapshotsreleases
- the policies to use for releasespublic java.lang.String pathOf(Artifact artifact)
pathOf
in interface ArtifactRepository
public java.lang.String pathOfRemoteRepositoryMetadata(ArtifactMetadata artifactMetadata)
pathOfRemoteRepositoryMetadata
in interface ArtifactRepository
public java.lang.String pathOfLocalRepositoryMetadata(ArtifactMetadata metadata, ArtifactRepository repository)
pathOfLocalRepositoryMetadata
in interface ArtifactRepository
public void setLayout(ArtifactRepositoryLayout layout)
setLayout
in interface ArtifactRepository
public ArtifactRepositoryLayout getLayout()
getLayout
in interface ArtifactRepository
public void setSnapshotUpdatePolicy(ArtifactRepositoryPolicy snapshots)
setSnapshotUpdatePolicy
in interface ArtifactRepository
public ArtifactRepositoryPolicy getSnapshots()
getSnapshots
in interface ArtifactRepository
public void setReleaseUpdatePolicy(ArtifactRepositoryPolicy releases)
setReleaseUpdatePolicy
in interface ArtifactRepository
public ArtifactRepositoryPolicy getReleases()
getReleases
in interface ArtifactRepository
public java.lang.String getKey()
getKey
in interface ArtifactRepository
public java.lang.String toString()
toString
in class java.lang.Object
public Artifact find(Artifact artifact)
find
in interface ArtifactRepository
public java.util.List<java.lang.String> findVersions(Artifact artifact)
ArtifactRepository
findVersions
in interface ArtifactRepository
artifact
- The artifact whose available versions should be determined, must not be null
.null
.public java.lang.String getId()
getId
in interface ArtifactRepository
public java.lang.String getUrl()
getUrl
in interface ArtifactRepository
public java.lang.String getBasedir()
getBasedir
in interface ArtifactRepository
public java.lang.String getProtocol()
getProtocol
in interface ArtifactRepository
public void setId(java.lang.String id)
setId
in interface ArtifactRepository
public void setUrl(java.lang.String url)
setUrl
in interface ArtifactRepository
private static java.lang.String protocol(java.lang.String url)
http://www.codehaus.org
this method will return http
url
- the urlprivate java.lang.String basedir(java.lang.String url)
url
- the repository URLprivate static java.lang.String decode(java.lang.String url)
url
- The URL to decode, may be null
.null
if the input was null
.public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
protected static <T> boolean eq(T s1, T s2)
public Authentication getAuthentication()
getAuthentication
in interface ArtifactRepository
public void setAuthentication(Authentication authentication)
setAuthentication
in interface ArtifactRepository
public Proxy getProxy()
getProxy
in interface ArtifactRepository
public void setProxy(Proxy proxy)
setProxy
in interface ArtifactRepository
public boolean isBlacklisted()
isBlacklisted
in interface ArtifactRepository
public void setBlacklisted(boolean blackListed)
setBlacklisted
in interface ArtifactRepository
public boolean isUniqueVersion()
isUniqueVersion
in interface ArtifactRepository
public boolean isProjectAware()
ArtifactRepository
isProjectAware
in interface ArtifactRepository
true
if the repository is backed by actual projects, false
otherwise.public java.util.List<ArtifactRepository> getMirroredRepositories()
getMirroredRepositories
in interface ArtifactRepository
public void setMirroredRepositories(java.util.List<ArtifactRepository> mirroredRepositories)
setMirroredRepositories
in interface ArtifactRepository
mirroredRepositories
- the repositories that the actual one mirrors