Package org.eclipse.aether.repository
Interface LocalRepositoryManager
-
public interface LocalRepositoryManager
Manages access to a local repository.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated 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.default java.nio.file.PathgetAbsolutePathForLocalArtifact(Artifact artifact)Gets the absolute path for a locally installed artifact.default java.nio.file.PathgetAbsolutePathForLocalMetadata(Metadata metadata)Gets the absolute path for locally installed metadata.default java.nio.file.PathgetAbsolutePathForRemoteArtifact(Artifact artifact, RemoteRepository repository, java.lang.String context)Gets the absolute path for an artifact cached from a remote repository.default java.nio.file.PathgetAbsolutePathForRemoteMetadata(Metadata metadata, RemoteRepository repository, java.lang.String context)Gets the absolute path for metadata cached from a remote repository.java.lang.StringgetPathForLocalArtifact(Artifact artifact)Deprecated.java.lang.StringgetPathForLocalMetadata(Metadata metadata)Deprecated.java.lang.StringgetPathForRemoteArtifact(Artifact artifact, RemoteRepository repository, java.lang.String context)java.lang.StringgetPathForRemoteMetadata(Metadata metadata, RemoteRepository repository, java.lang.String context)LocalRepositorygetRepository()Gets the description of the local repository being managed.
-
-
-
Method Detail
-
getRepository
LocalRepository getRepository()
Gets the description of the local repository being managed.- Returns:
- The description of the local repository, never
null.
-
getAbsolutePathForLocalArtifact
default java.nio.file.Path getAbsolutePathForLocalArtifact(Artifact artifact)
Gets the absolute 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.- Parameters:
artifact- The artifact for which to determine the path, must not benull.- Returns:
- The path, relative to the local repository's base directory.
- Since:
- 2.0.5
-
getPathForLocalArtifact
@Deprecated java.lang.String getPathForLocalArtifact(Artifact artifact)
Deprecated.Gets 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.- Parameters:
artifact- The artifact for which to determine the path, must not benull.- Returns:
- The path, relative to the local repository's base directory.
-
getAbsolutePathForRemoteArtifact
default java.nio.file.Path getAbsolutePathForRemoteArtifact(Artifact artifact, RemoteRepository repository, java.lang.String context)
Gets the absolute 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.- 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.
- Since:
- 2.0.5
-
getPathForRemoteArtifact
@Deprecated java.lang.String getPathForRemoteArtifact(Artifact artifact, RemoteRepository repository, java.lang.String context)
Gets 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.- 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.
-
getAbsolutePathForLocalMetadata
default java.nio.file.Path getAbsolutePathForLocalMetadata(Metadata metadata)
Gets the absolute 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.- Parameters:
metadata- The metadata for which to determine the path, must not benull.- Returns:
- The path, relative to the local repository's base directory.
- Since:
- 2.0.5
-
getPathForLocalMetadata
@Deprecated java.lang.String getPathForLocalMetadata(Metadata metadata)
Deprecated.Gets 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.- Parameters:
metadata- The metadata for which to determine the path, must not benull.- Returns:
- The path, relative to the local repository's base directory.
-
getAbsolutePathForRemoteMetadata
default java.nio.file.Path getAbsolutePathForRemoteMetadata(Metadata metadata, RemoteRepository repository, java.lang.String context)
Gets the absolute 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.- 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.
- Since:
- 2.0.5
-
getPathForRemoteMetadata
@Deprecated java.lang.String getPathForRemoteMetadata(Metadata metadata, RemoteRepository repository, java.lang.String context)
Gets 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.- 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.
-
find
LocalArtifactResult find(RepositorySystemSession session, LocalArtifactRequest request)
Queries 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.- 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
void add(RepositorySystemSession session, LocalArtifactRegistration request)
Registers 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.- Parameters:
session- The repository system session during which the registration is made, must not benull.request- The registration request, must not benull.
-
find
LocalMetadataResult find(RepositorySystemSession session, LocalMetadataRequest request)
Queries for the existence of metadata in the local repository. The request could be satisfied by locally installed or previously downloaded metadata.- 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
void add(RepositorySystemSession session, LocalMetadataRegistration request)
Registers 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.- Parameters:
session- The repository system session during which the registration is made, must not benull.request- The registration request, must not benull.
-
-