org.eclipse.aether.util.repository

## Class ChainedWorkspaceReader

- java.lang.Object
- - org.eclipse.aether.util.repository.ChainedWorkspaceReader

- All Implemented Interfaces:
    WorkspaceReader

      public final class ChainedWorkspaceReader
      extends Object
      implements WorkspaceReader

  A workspace reader that delegates to a chain of other readers, effectively aggregating their contents.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ChainedWorkspaceReader(WorkspaceReader... readers)` Creates a new workspace reader by chaining the specified readers.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `File` | `findArtifact(Artifact artifact)` Locates the specified artifact.
    `List<String>` | `findVersions(Artifact artifact)` Determines all available versions of the specified artifact.
    `WorkspaceRepository` | `getRepository()` Gets a description of the workspace repository.
    `static WorkspaceReader` | `newInstance(WorkspaceReader reader1, WorkspaceReader reader2)` Creates a new workspace reader by chaining the specified readers.

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

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

- - ### Constructor Detail

    - #### ChainedWorkspaceReader

          public ChainedWorkspaceReader(WorkspaceReader... readers)

      Creates a new workspace reader by chaining the specified readers.
      Parameters:
        `readers` - The readers to chain, may be `null`.
      See Also:
        `newInstance(WorkspaceReader, WorkspaceReader)`

  - ### Method Detail

    - #### newInstance

          public static WorkspaceReader newInstance(WorkspaceReader reader1,
                                    WorkspaceReader reader2)

      Creates a new workspace reader by chaining the specified readers. In contrast to the constructor, this factory method will avoid creating an actual chained reader if one of the specified readers is actually `null`.
      Parameters:
        `reader1` - The first workspace reader, may be `null`.
        `reader2` - The second workspace reader, may be `null`.
      Returns:
        The chained reader or `null` if no workspace reader was supplied.

    - #### findArtifact

          public File findArtifact(Artifact artifact)

      Description copied from interface: `WorkspaceReader`
      Locates the specified artifact.
      Specified by:
        `findArtifact` in interface `WorkspaceReader`
      Parameters:
        `artifact` - The artifact to locate, must not be `null`.
      Returns:
        The path to the artifact or `null` if the artifact is not available.

    - #### findVersions

          public List<String> findVersions(Artifact artifact)

      Description copied from interface: `WorkspaceReader`
      Determines all available versions of the specified artifact.
      Specified by:
        `findVersions` in interface `WorkspaceReader`
      Parameters:
        `artifact` - The artifact whose versions should be listed, must not be `null`.
      Returns:
        The available versions of the artifact, must not be `null`.

    - #### getRepository

          public WorkspaceRepository getRepository()

      Description copied from interface: `WorkspaceReader`
      Gets a description of the workspace repository.
      Specified by:
        `getRepository` in interface `WorkspaceReader`
      Returns:
        The repository description, never `null`.

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