Class ChainedWorkspaceReader
- java.lang.Object
-
- org.eclipse.aether.util.repository.ChainedWorkspaceReader
-
- All Implemented Interfaces:
WorkspaceReader
public final class ChainedWorkspaceReader extends java.lang.Object implements WorkspaceReader
A workspace reader that delegates to a chain of other readers, effectively aggregating their contents.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classChainedWorkspaceReader.Key
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<WorkspaceReader>readersprivate WorkspaceRepositoryrepository
-
Constructor Summary
Constructors Constructor Description ChainedWorkspaceReader(WorkspaceReader... readers)Creates a new workspace reader by chaining the specified readers.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.FilefindArtifact(Artifact artifact)Locates the specified artifact.java.util.List<java.lang.String>findVersions(Artifact artifact)Determines all available versions of the specified artifact.WorkspaceRepositorygetRepository()Gets a description of the workspace repository.static WorkspaceReadernewInstance(WorkspaceReader reader1, WorkspaceReader reader2)Creates a new workspace reader by chaining the specified readers.
-
-
-
Field Detail
-
readers
private java.util.List<WorkspaceReader> readers
-
repository
private WorkspaceRepository repository
-
-
Constructor Detail
-
ChainedWorkspaceReader
public ChainedWorkspaceReader(WorkspaceReader... readers)
Creates a new workspace reader by chaining the specified readers.- Parameters:
readers- The readers to chain, may benull.- 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 actuallynull.- Parameters:
reader1- The first workspace reader, may benull.reader2- The second workspace reader, may benull.- Returns:
- The chained reader or
nullif no workspace reader was supplied.
-
findArtifact
public java.io.File findArtifact(Artifact artifact)
Description copied from interface:WorkspaceReaderLocates the specified artifact.- Specified by:
findArtifactin interfaceWorkspaceReader- Parameters:
artifact- The artifact to locate, must not benull.- Returns:
- The path to the artifact or
nullif the artifact is not available.
-
findVersions
public java.util.List<java.lang.String> findVersions(Artifact artifact)
Description copied from interface:WorkspaceReaderDetermines all available versions of the specified artifact.- Specified by:
findVersionsin interfaceWorkspaceReader- Parameters:
artifact- The artifact whose versions should be listed, must not benull.- Returns:
- The available versions of the artifact, must not be
null.
-
getRepository
public WorkspaceRepository getRepository()
Description copied from interface:WorkspaceReaderGets a description of the workspace repository.- Specified by:
getRepositoryin interfaceWorkspaceReader- Returns:
- The repository description, never
null.
-
-