Package org.eclipse.aether.repository
Class RemoteRepository.Builder
java.lang.Object
org.eclipse.aether.repository.RemoteRepository.Builder
- Enclosing class:
- RemoteRepository
A builder to create remote repositories.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final int
(package private) Authentication
(package private) boolean
(package private) static final int
private static final RepositoryPolicy
(package private) int
(package private) String
(package private) static final int
(package private) static final int
(package private) List<RemoteRepository>
(package private) RemoteRepository
(package private) Proxy
(package private) static final int
(package private) RepositoryPolicy
(package private) static final int
(package private) static final int
(package private) boolean
(package private) RepositoryPolicy
(package private) static final int
(package private) String
(package private) static final int
(package private) String
(package private) static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddMirroredRepository
(RemoteRepository mirroredRepository) Adds the specified repository to the list of repositories being mirrored by the repository.build()
Builds a new remote repository from the current values of this builder.private <T> void
delta
(int flag, T builder, T prototype) setAuthentication
(Authentication authentication) Sets the authentication to use in order to access the repository.setBlocked
(boolean blocked) Marks the repository as blocked or not.setContentType
(String type) Sets the type of the repository, e.g.Sets the identifier of the repository.setMirroredRepositories
(List<RemoteRepository> mirroredRepositories) Sets the repositories being mirrored by the repository.setPolicy
(RepositoryPolicy policy) Sets the policy to apply for snapshot and release artifacts.Sets the proxy to use in order to access the repository.setReleasePolicy
(RepositoryPolicy releasePolicy) Sets the policy to apply for release artifacts.setRepositoryManager
(boolean repositoryManager) Marks the repository as a repository manager or not.setSnapshotPolicy
(RepositoryPolicy snapshotPolicy) Sets the policy to apply for snapshot artifacts.Sets the (base) URL of the repository.
-
Field Details
-
DEFAULT_POLICY
-
ID
static final int ID- See Also:
-
TYPE
static final int TYPE- See Also:
-
URL
static final int URL- See Also:
-
RELEASES
static final int RELEASES- See Also:
-
SNAPSHOTS
static final int SNAPSHOTS- See Also:
-
PROXY
static final int PROXY- See Also:
-
AUTH
static final int AUTH- See Also:
-
MIRRORED
static final int MIRRORED- See Also:
-
REPOMAN
static final int REPOMAN- See Also:
-
BLOCKED
static final int BLOCKED- See Also:
-
delta
int delta -
prototype
RemoteRepository prototype -
id
String id -
type
String type -
url
String url -
releasePolicy
RepositoryPolicy releasePolicy -
snapshotPolicy
RepositoryPolicy snapshotPolicy -
proxy
Proxy proxy -
authentication
Authentication authentication -
mirroredRepositories
List<RemoteRepository> mirroredRepositories -
repositoryManager
boolean repositoryManager -
blocked
boolean blocked
-
-
Constructor Details
-
Builder
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
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 Details
-
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
Sets the identifier of the repository.- Parameters:
id
- The identifier of the repository, may benull
.- Returns:
- This builder for chaining, never
null
.
-
setContentType
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
Sets the (base) URL of the repository.- Parameters:
url
- The URL of the repository, may benull
.- Returns:
- This builder for chaining, never
null
.
-
setPolicy
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
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
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
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
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(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
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
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
.
-
setBlocked
Marks the repository as blocked or not.- Parameters:
blocked
-true
if the repository should not be allowed to perform any requests.- Returns:
- This builder for chaining, never
null
.
-