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 Object

  A builder to create remote repositories.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RemoteRepository.Builder(RemoteRepository prototype)` Creates a new repository builder which uses the specified remote repository as a prototype for the new one.
    `RemoteRepository.Builder(String id, String type, String url)` Creates a new repository builder.

  - ### Method Summary

    Methods
    Modifier and Type | Method and 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.
    `RemoteRepository.Builder` | `setAuthentication(Authentication authentication)` Sets the authentication to use in order to access the repository.
    `RemoteRepository.Builder` | `setContentType(String type)` Sets the type of the repository, e.g.
    `RemoteRepository.Builder` | `setId(String id)` Sets the identifier of the repository.
    `RemoteRepository.Builder` | `setMirroredRepositories(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(String url)` Sets the (base) URL of the repository.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### RemoteRepository.Builder

          public RemoteRepository.Builder(String id,
                                  String type,
                                  String url)

      Creates a new repository builder.
      Parameters:
        `id` - The identifier of the repository, may be `null`.
        `type` - The type of the repository, may be `null`.
        `url` - The (base) URL of the repository, may be `null`.

    - #### RemoteRepository.Builder

          public RemoteRepository.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 be `null`.

  - ### 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`.

    - #### setId

          public RemoteRepository.Builder setId(String id)

      Sets the identifier of the repository.
      Parameters:
        `id` - The identifier of the repository, may be `null`.
      Returns:
        This builder for chaining, never `null`.

    - #### setContentType

          public RemoteRepository.Builder setContentType(String type)

      Sets the type of the repository, e.g. "default".
      Parameters:
        `type` - The type of the repository, may be `null`.
      Returns:
        This builder for chaining, never `null`.

    - #### setUrl

          public RemoteRepository.Builder setUrl(String url)

      Sets the (base) URL of the repository.
      Parameters:
        `url` - The URL of the repository, may be `null`.
      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 be `null` 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 be `null` 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 be `null` 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 be `null`.
      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 be `null`.
      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 be `null`.
      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 was `constructed 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 be `null`.
      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`.

Copyright © 2010-2013 The Eclipse Foundation. All Rights Reserved.