Package org.eclipse.aether.internal.impl
Class SimpleLocalRepositoryManager
- java.lang.Object
-
- org.eclipse.aether.internal.impl.SimpleLocalRepositoryManager
-
- All Implemented Interfaces:
LocalRepositoryManager
- Direct Known Subclasses:
EnhancedLocalRepositoryManager
class SimpleLocalRepositoryManager extends java.lang.Object implements LocalRepositoryManager
A local repository manager that realizes the classical Maven 2.0 local repository.
-
-
Field Summary
Fields Modifier and Type Field Description private LocalRepositoryrepository
-
Constructor Summary
Constructors Constructor Description SimpleLocalRepositoryManager(java.io.File basedir)SimpleLocalRepositoryManager(java.io.File basedir, java.lang.String type)SimpleLocalRepositoryManager(java.lang.String basedir)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(RepositorySystemSession session, LocalArtifactRegistration request)Registers an installed or resolved artifact with the local repository.voidadd(RepositorySystemSession session, LocalMetadataRegistration request)Registers installed or resolved metadata with the local repository.LocalArtifactResultfind(RepositorySystemSession session, LocalArtifactRequest request)Queries for the existence of an artifact in the local repository.LocalMetadataResultfind(RepositorySystemSession session, LocalMetadataRequest request)Queries for the existence of metadata in the local repository.private java.lang.StringgetPath(Metadata metadata, java.lang.String repositoryKey)(package private) java.lang.StringgetPathForArtifact(Artifact artifact, boolean local)java.lang.StringgetPathForLocalArtifact(Artifact artifact)Gets the relative path for a locally installed artifact.java.lang.StringgetPathForLocalMetadata(Metadata metadata)Gets the relative path for locally installed metadata.java.lang.StringgetPathForRemoteArtifact(Artifact artifact, RemoteRepository repository, java.lang.String context)Gets the relative path for an artifact cached from a remote repository.java.lang.StringgetPathForRemoteMetadata(Metadata metadata, RemoteRepository repository, java.lang.String context)Gets the relative path for metadata cached from a remote repository.LocalRepositorygetRepository()Gets the description of the local repository being managed.(package private) java.lang.StringgetRepositoryKey(RemoteRepository repository, java.lang.String context)private java.lang.StringinsertRepositoryKey(java.lang.String filename, java.lang.String repositoryKey)java.lang.StringtoString()
-
-
-
Field Detail
-
repository
private final LocalRepository repository
-
-
Method Detail
-
getRepository
public LocalRepository getRepository()
Description copied from interface:LocalRepositoryManagerGets the description of the local repository being managed.- Specified by:
getRepositoryin interfaceLocalRepositoryManager- Returns:
- The description of the local repository, never
null.
-
getPathForArtifact
java.lang.String getPathForArtifact(Artifact artifact, boolean local)
-
getPathForLocalArtifact
public java.lang.String getPathForLocalArtifact(Artifact artifact)
Description copied from interface:LocalRepositoryManagerGets the relative path for a locally installed artifact. Note that the artifact need not actually exist yet at the returned location, the path merely indicates where the artifact would eventually be stored. The path uses the forward slash as directory separator regardless of the underlying file system.- Specified by:
getPathForLocalArtifactin interfaceLocalRepositoryManager- Parameters:
artifact- The artifact for which to determine the path, must not benull.- Returns:
- The path, relative to the local repository's base directory.
-
getPathForRemoteArtifact
public java.lang.String getPathForRemoteArtifact(Artifact artifact, RemoteRepository repository, java.lang.String context)
Description copied from interface:LocalRepositoryManagerGets the relative path for an artifact cached from a remote repository. Note that the artifact need not actually exist yet at the returned location, the path merely indicates where the artifact would eventually be stored. The path uses the forward slash as directory separator regardless of the underlying file system.- Specified by:
getPathForRemoteArtifactin interfaceLocalRepositoryManager- Parameters:
artifact- The artifact for which to determine the path, must not benull.repository- The source repository of the artifact, must not benull.context- The resolution context in which the artifact is being requested, may benull.- Returns:
- The path, relative to the local repository's base directory.
-
getPathForLocalMetadata
public java.lang.String getPathForLocalMetadata(Metadata metadata)
Description copied from interface:LocalRepositoryManagerGets the relative path for locally installed metadata. Note that the metadata need not actually exist yet at the returned location, the path merely indicates where the metadata would eventually be stored. The path uses the forward slash as directory separator regardless of the underlying file system.- Specified by:
getPathForLocalMetadatain interfaceLocalRepositoryManager- Parameters:
metadata- The metadata for which to determine the path, must not benull.- Returns:
- The path, relative to the local repository's base directory.
-
getPathForRemoteMetadata
public java.lang.String getPathForRemoteMetadata(Metadata metadata, RemoteRepository repository, java.lang.String context)
Description copied from interface:LocalRepositoryManagerGets the relative path for metadata cached from a remote repository. Note that the metadata need not actually exist yet at the returned location, the path merely indicates where the metadata would eventually be stored. The path uses the forward slash as directory separator regardless of the underlying file system.- Specified by:
getPathForRemoteMetadatain interfaceLocalRepositoryManager- Parameters:
metadata- The metadata for which to determine the path, must not benull.repository- The source repository of the metadata, must not benull.context- The resolution context in which the metadata is being requested, may benull.- Returns:
- The path, relative to the local repository's base directory.
-
getRepositoryKey
java.lang.String getRepositoryKey(RemoteRepository repository, java.lang.String context)
-
getPath
private java.lang.String getPath(Metadata metadata, java.lang.String repositoryKey)
-
insertRepositoryKey
private java.lang.String insertRepositoryKey(java.lang.String filename, java.lang.String repositoryKey)
-
find
public LocalArtifactResult find(RepositorySystemSession session, LocalArtifactRequest request)
Description copied from interface:LocalRepositoryManagerQueries for the existence of an artifact in the local repository. The request could be satisfied by a locally installed artifact or a previously downloaded artifact.- Specified by:
findin interfaceLocalRepositoryManager- Parameters:
session- The repository system session during which the request is made, must not benull.request- The artifact request, must not benull.- Returns:
- The result of the request, never
null.
-
add
public void add(RepositorySystemSession session, LocalArtifactRegistration request)
Description copied from interface:LocalRepositoryManagerRegisters an installed or resolved artifact with the local repository. Note that artifact registration is merely concerned about updating the local repository's internal state, not about actually installing the artifact or its accompanying metadata.- Specified by:
addin interfaceLocalRepositoryManager- Parameters:
session- The repository system session during which the registration is made, must not benull.request- The registration request, must not benull.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
find
public LocalMetadataResult find(RepositorySystemSession session, LocalMetadataRequest request)
Description copied from interface:LocalRepositoryManagerQueries for the existence of metadata in the local repository. The request could be satisfied by locally installed or previously downloaded metadata.- Specified by:
findin interfaceLocalRepositoryManager- Parameters:
session- The repository system session during which the request is made, must not benull.request- The metadata request, must not benull.- Returns:
- The result of the request, never
null.
-
add
public void add(RepositorySystemSession session, LocalMetadataRegistration request)
Description copied from interface:LocalRepositoryManagerRegisters installed or resolved metadata with the local repository. Note that metadata registration is merely concerned about updating the local repository's internal state, not about actually installing the metadata. However, this method MUST be called after the actual install to give the repository manager the opportunity to inspect the added metadata.- Specified by:
addin interfaceLocalRepositoryManager- Parameters:
session- The repository system session during which the registration is made, must not benull.request- The registration request, must not benull.
-
-