Package org.eclipse.aether.repository
Class RemoteRepository.Builder
- java.lang.Object
-
- org.eclipse.aether.repository.RemoteRepository.Builder
-
- Enclosing class:
- RemoteRepository
public static final class RemoteRepository.Builder extends java.lang.Object
A builder to create remote repositories.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static int
AUTH
(package private) Authentication
authentication
private static RepositoryPolicy
DEFAULT_POLICY
(package private) int
delta
(package private) java.lang.String
id
(package private) static int
ID
(package private) static int
MIRRORED
(package private) java.util.List<RemoteRepository>
mirroredRepositories
(package private) RemoteRepository
prototype
(package private) Proxy
proxy
(package private) static int
PROXY
(package private) RepositoryPolicy
releasePolicy
(package private) static int
RELEASES
(package private) static int
REPOMAN
(package private) boolean
repositoryManager
(package private) RepositoryPolicy
snapshotPolicy
(package private) static int
SNAPSHOTS
(package private) java.lang.String
type
(package private) static int
TYPE
(package private) java.lang.String
url
(package private) static int
URL
-
Constructor Summary
Constructors Constructor Description Builder(java.lang.String id, java.lang.String type, java.lang.String url)
Creates a new repository builder.Builder(RemoteRepository prototype)
Creates a new repository builder which uses the specified remote repository as a prototype for the new one.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RemoteRepository.Builder
addMirroredRepository(RemoteRepository mirroredRepository)
Adds the specified repository to the list of repositories being mirrored by the repository.RemoteRepository
build()
Builds a new remote repository from the current values of this builder.private <T> void
delta(int flag, T builder, T prototype)
RemoteRepository.Builder
setAuthentication(Authentication authentication)
Sets the authentication to use in order to access the repository.RemoteRepository.Builder
setContentType(java.lang.String type)
Sets the type of the repository, e.g.RemoteRepository.Builder
setId(java.lang.String id)
Sets the identifier of the repository.RemoteRepository.Builder
setMirroredRepositories(java.util.List<RemoteRepository> mirroredRepositories)
Sets the repositories being mirrored by the repository.RemoteRepository.Builder
setPolicy(RepositoryPolicy policy)
Sets the policy to apply for snapshot and release artifacts.RemoteRepository.Builder
setProxy(Proxy proxy)
Sets the proxy to use in order to access the repository.RemoteRepository.Builder
setReleasePolicy(RepositoryPolicy releasePolicy)
Sets the policy to apply for release artifacts.RemoteRepository.Builder
setRepositoryManager(boolean repositoryManager)
Marks the repository as a repository manager or not.RemoteRepository.Builder
setSnapshotPolicy(RepositoryPolicy snapshotPolicy)
Sets the policy to apply for snapshot artifacts.RemoteRepository.Builder
setUrl(java.lang.String url)
Sets the (base) URL of the repository.
-
-
-
Field Detail
-
DEFAULT_POLICY
private static final RepositoryPolicy DEFAULT_POLICY
-
ID
static final int ID
- See Also:
- Constant Field Values
-
TYPE
static final int TYPE
- See Also:
- Constant Field Values
-
URL
static final int URL
- See Also:
- Constant Field Values
-
RELEASES
static final int RELEASES
- See Also:
- Constant Field Values
-
SNAPSHOTS
static final int SNAPSHOTS
- See Also:
- Constant Field Values
-
PROXY
static final int PROXY
- See Also:
- Constant Field Values
-
AUTH
static final int AUTH
- See Also:
- Constant Field Values
-
MIRRORED
static final int MIRRORED
- See Also:
- Constant Field Values
-
REPOMAN
static final int REPOMAN
- See Also:
- Constant Field Values
-
delta
int delta
-
prototype
RemoteRepository prototype
-
id
java.lang.String id
-
type
java.lang.String type
-
url
java.lang.String url
-
releasePolicy
RepositoryPolicy releasePolicy
-
snapshotPolicy
RepositoryPolicy snapshotPolicy
-
proxy
Proxy proxy
-
authentication
Authentication authentication
-
mirroredRepositories
java.util.List<RemoteRepository> mirroredRepositories
-
repositoryManager
boolean repositoryManager
-
-
Constructor Detail
-
Builder
public Builder(java.lang.String id, java.lang.String type, java.lang.String url)
Creates a new repository builder.- Parameters:
id
- The identifier of the repository, may benull
.type
- The type of the repository, may benull
.url
- The (base) URL of the repository, may benull
.
-
Builder
public Builder(RemoteRepository prototype)
Creates a new repository builder which uses the specified remote repository as a prototype for the new one. All properties which have not been set on the builder will be copied from the prototype when building the repository.- Parameters:
prototype
- The remote repository to use as prototype, must not benull
.
-
-
Method Detail
-
build
public RemoteRepository build()
Builds a new remote repository from the current values of this builder. The state of the builder itself remains unchanged.- Returns:
- The remote repository, never
null
.
-
delta
private <T> void delta(int flag, T builder, T prototype)
-
setId
public RemoteRepository.Builder setId(java.lang.String id)
Sets the identifier of the repository.- Parameters:
id
- The identifier of the repository, may benull
.- Returns:
- This builder for chaining, never
null
.
-
setContentType
public RemoteRepository.Builder setContentType(java.lang.String type)
Sets the type of the repository, e.g. "default".- Parameters:
type
- The type of the repository, may benull
.- Returns:
- This builder for chaining, never
null
.
-
setUrl
public RemoteRepository.Builder setUrl(java.lang.String url)
Sets the (base) URL of the repository.- Parameters:
url
- The URL of the repository, may benull
.- Returns:
- This builder for chaining, never
null
.
-
setPolicy
public RemoteRepository.Builder setPolicy(RepositoryPolicy policy)
Sets the policy to apply for snapshot and release artifacts.- Parameters:
policy
- The repository policy to set, may benull
to use a default policy.- Returns:
- This builder for chaining, never
null
.
-
setReleasePolicy
public RemoteRepository.Builder setReleasePolicy(RepositoryPolicy releasePolicy)
Sets the policy to apply for release artifacts.- Parameters:
releasePolicy
- The repository policy to set, may benull
to use a default policy.- Returns:
- This builder for chaining, never
null
.
-
setSnapshotPolicy
public RemoteRepository.Builder setSnapshotPolicy(RepositoryPolicy snapshotPolicy)
Sets the policy to apply for snapshot artifacts.- Parameters:
snapshotPolicy
- The repository policy to set, may benull
to use a default policy.- Returns:
- This builder for chaining, never
null
.
-
setProxy
public RemoteRepository.Builder setProxy(Proxy proxy)
Sets the proxy to use in order to access the repository.- Parameters:
proxy
- The proxy to use, may benull
.- Returns:
- This builder for chaining, never
null
.
-
setAuthentication
public RemoteRepository.Builder setAuthentication(Authentication authentication)
Sets the authentication to use in order to access the repository.- Parameters:
authentication
- The authentication to use, may benull
.- Returns:
- This builder for chaining, never
null
.
-
setMirroredRepositories
public RemoteRepository.Builder setMirroredRepositories(java.util.List<RemoteRepository> mirroredRepositories)
Sets the repositories being mirrored by the repository.- Parameters:
mirroredRepositories
- The repositories being mirrored by the repository, may benull
.- Returns:
- This builder for chaining, never
null
.
-
addMirroredRepository
public RemoteRepository.Builder addMirroredRepository(RemoteRepository mirroredRepository)
Adds the specified repository to the list of repositories being mirrored by the repository. If this builder wasconstructed from a prototype
, the given repository will be added to the list of mirrored repositories from the prototype.- Parameters:
mirroredRepository
- The repository being mirrored by the repository, may benull
.- Returns:
- This builder for chaining, never
null
.
-
setRepositoryManager
public RemoteRepository.Builder setRepositoryManager(boolean repositoryManager)
Marks the repository as a repository manager or not.- Parameters:
repositoryManager
-true
if the repository points at a repository manager,false
if the repository is just serving static contents.- Returns:
- This builder for chaining, never
null
.
-
-