Package org.eclipse.aether.repository
Class RemoteRepository
- java.lang.Object
-
- org.eclipse.aether.repository.RemoteRepository
-
- All Implemented Interfaces:
ArtifactRepository
public final class RemoteRepository extends java.lang.Object implements ArtifactRepository
A repository on a remote server.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRemoteRepository.BuilderA builder to create remote repositories.
-
Field Summary
Fields Modifier and Type Field Description private Authenticationauthenticationprivate java.lang.Stringhostprivate java.lang.Stringidprivate java.util.List<RemoteRepository>mirroredRepositoriesprivate java.lang.Stringprotocolprivate Proxyproxyprivate RepositoryPolicyreleasePolicyprivate booleanrepositoryManagerprivate RepositoryPolicysnapshotPolicyprivate java.lang.Stringtypeprivate java.lang.Stringurlprivate static java.util.regex.PatternURL_PATTERN
-
Constructor Summary
Constructors Constructor Description RemoteRepository(RemoteRepository.Builder builder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static java.util.List<RemoteRepository>copy(java.util.List<RemoteRepository> repos)booleanequals(java.lang.Object obj)AuthenticationgetAuthentication()Gets the authentication that has been selected for this repository.java.lang.StringgetContentType()Gets the type of the repository, for example "default".java.lang.StringgetHost()Gets the host part from the repository's URL.java.lang.StringgetId()Gets the identifier of this repository.java.util.List<RemoteRepository>getMirroredRepositories()Gets the repositories that this repository serves as a mirror for.RepositoryPolicygetPolicy(boolean snapshot)Gets the policy to apply for snapshot/release artifacts.java.lang.StringgetProtocol()Gets the protocol part from the repository's URL, for examplefileorhttp.ProxygetProxy()Gets the proxy that has been selected for this repository.java.lang.StringgetUrl()Gets the (base) URL of this repository.private static inthash(java.lang.Object obj)inthashCode()booleanisRepositoryManager()Indicates whether this repository refers to a repository manager or not.java.lang.StringtoString()
-
-
-
Field Detail
-
URL_PATTERN
private static final java.util.regex.Pattern URL_PATTERN
-
id
private final java.lang.String id
-
type
private final java.lang.String type
-
url
private final java.lang.String url
-
host
private final java.lang.String host
-
protocol
private final java.lang.String protocol
-
releasePolicy
private final RepositoryPolicy releasePolicy
-
snapshotPolicy
private final RepositoryPolicy snapshotPolicy
-
proxy
private final Proxy proxy
-
authentication
private final Authentication authentication
-
mirroredRepositories
private final java.util.List<RemoteRepository> mirroredRepositories
-
repositoryManager
private final boolean repositoryManager
-
-
Constructor Detail
-
RemoteRepository
RemoteRepository(RemoteRepository.Builder builder)
-
-
Method Detail
-
copy
private static java.util.List<RemoteRepository> copy(java.util.List<RemoteRepository> repos)
-
getId
public java.lang.String getId()
Description copied from interface:ArtifactRepositoryGets the identifier of this repository.- Specified by:
getIdin interfaceArtifactRepository- Returns:
- The (case-sensitive) identifier, never
null.
-
getContentType
public java.lang.String getContentType()
Description copied from interface:ArtifactRepositoryGets the type of the repository, for example "default".- Specified by:
getContentTypein interfaceArtifactRepository- Returns:
- The (case-sensitive) type of the repository, never
null.
-
getUrl
public java.lang.String getUrl()
Gets the (base) URL of this repository.- Returns:
- The (base) URL of this repository, never
null.
-
getProtocol
public java.lang.String getProtocol()
Gets the protocol part from the repository's URL, for examplefileorhttp. As suggested by RFC 2396, section 3.1 "Scheme Component", the protocol name should be treated case-insensitively.- Returns:
- The protocol or an empty string if none, never
null.
-
getHost
public java.lang.String getHost()
Gets the host part from the repository's URL.- Returns:
- The host or an empty string if none, never
null.
-
getPolicy
public RepositoryPolicy getPolicy(boolean snapshot)
Gets the policy to apply for snapshot/release artifacts.- Parameters:
snapshot-trueto retrieve the snapshot policy,falseto retrieve the release policy.- Returns:
- The requested repository policy, never
null.
-
getProxy
public Proxy getProxy()
Gets the proxy that has been selected for this repository.- Returns:
- The selected proxy or
nullif none.
-
getAuthentication
public Authentication getAuthentication()
Gets the authentication that has been selected for this repository.- Returns:
- The selected authentication or
nullif none.
-
getMirroredRepositories
public java.util.List<RemoteRepository> getMirroredRepositories()
Gets the repositories that this repository serves as a mirror for.- Returns:
- The (read-only) repositories being mirrored by this repository, never
null.
-
isRepositoryManager
public boolean isRepositoryManager()
Indicates whether this repository refers to a repository manager or not.- Returns:
trueif this repository is a repository manager,falseotherwise.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
hash
private static int hash(java.lang.Object obj)
-
-