Package org.eclipse.aether.internal.impl
Class EnhancedLocalRepositoryManager
java.lang.Object
org.eclipse.aether.internal.impl.SimpleLocalRepositoryManager
org.eclipse.aether.internal.impl.EnhancedLocalRepositoryManager
- All Implemented Interfaces:
LocalRepositoryManager
These are implementation details for enhanced local repository manager, subject to change without prior notice.
Repositories from which a cached artifact was resolved are tracked in a properties file named
_remote.repositories
, with content key as filename>repo_id and value as empty string. If a file has
been installed in the repository, but not downloaded from a remote repository, it is tracked as empty repository id
and always resolved. For example:
artifact-1.0.pom>= artifact-1.0.jar>= artifact-1.0.pom>central= artifact-1.0.jar>central= artifact-1.0.zip>central= artifact-1.0-classifier.zip>central= artifact-1.0.pom>my_repo_id=
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
private final LocalPathPrefixComposer
private final TrackingFileManager
private final String
-
Constructor Summary
ConstructorsConstructorDescriptionEnhancedLocalRepositoryManager
(File basedir, LocalPathComposer localPathComposer, String trackingFilename, TrackingFileManager trackingFileManager, LocalPathPrefixComposer localPathPrefixComposer) -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(RepositorySystemSession session, LocalArtifactRegistration request) Registers an installed or resolved artifact with the local repository.private void
addArtifact
(Artifact artifact, Collection<String> repositories, RemoteRepository repository, String context) private void
addRepo
(File artifactFile, Collection<String> repositories) private void
checkFind
(File file, LocalArtifactResult result) private String
concatPaths
(String prefix, String artifactPath) find
(RepositorySystemSession session, LocalArtifactRequest request) Queries for the existence of an artifact in the local repository.private String
getPathForLocalArtifact
(Artifact artifact) Gets the relative path for a locally installed artifact.getPathForLocalMetadata
(Metadata metadata) Gets the relative path for locally installed metadata.getPathForRemoteArtifact
(Artifact artifact, RemoteRepository repository, String context) Gets the relative path for an artifact cached from a remote repository.getPathForRemoteMetadata
(Metadata metadata, RemoteRepository repository, String context) Gets the relative path for metadata cached from a remote repository.private Collection
<String> getRepositoryKeys
(RemoteRepository repository, Collection<String> contexts) private File
getTrackingFile
(File artifactFile) private boolean
isTracked
(Properties props, File file) private Properties
Methods inherited from class org.eclipse.aether.internal.impl.SimpleLocalRepositoryManager
add, find, getRepository, getRepositoryKey, toString
-
Field Details
-
LOCAL_REPO_ID
- See Also:
-
trackingFilename
-
trackingFileManager
-
localPathPrefixComposer
-
-
Constructor Details
-
EnhancedLocalRepositoryManager
EnhancedLocalRepositoryManager(File basedir, LocalPathComposer localPathComposer, String trackingFilename, TrackingFileManager trackingFileManager, LocalPathPrefixComposer localPathPrefixComposer)
-
-
Method Details
-
concatPaths
-
getPathForLocalArtifact
Description copied from interface:LocalRepositoryManager
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.- Specified by:
getPathForLocalArtifact
in interfaceLocalRepositoryManager
- Overrides:
getPathForLocalArtifact
in classSimpleLocalRepositoryManager
- 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 String getPathForRemoteArtifact(Artifact artifact, RemoteRepository repository, String context) Description copied from interface:LocalRepositoryManager
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.- Specified by:
getPathForRemoteArtifact
in interfaceLocalRepositoryManager
- Overrides:
getPathForRemoteArtifact
in classSimpleLocalRepositoryManager
- 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
Description copied from interface:LocalRepositoryManager
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.- Specified by:
getPathForLocalMetadata
in interfaceLocalRepositoryManager
- Overrides:
getPathForLocalMetadata
in classSimpleLocalRepositoryManager
- 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 String getPathForRemoteMetadata(Metadata metadata, RemoteRepository repository, String context) Description copied from interface:LocalRepositoryManager
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.- Specified by:
getPathForRemoteMetadata
in interfaceLocalRepositoryManager
- Overrides:
getPathForRemoteMetadata
in classSimpleLocalRepositoryManager
- 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
Description copied from interface:LocalRepositoryManager
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.- Specified by:
find
in interfaceLocalRepositoryManager
- Overrides:
find
in classSimpleLocalRepositoryManager
- 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
.
-
checkFind
-
add
Description copied from interface:LocalRepositoryManager
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.- Specified by:
add
in interfaceLocalRepositoryManager
- Overrides:
add
in classSimpleLocalRepositoryManager
- Parameters:
session
- The repository system session during which the registration is made, must not benull
.request
- The registration request, must not benull
.
-
getRepositoryKeys
private Collection<String> getRepositoryKeys(RemoteRepository repository, Collection<String> contexts) -
addArtifact
private void addArtifact(Artifact artifact, Collection<String> repositories, RemoteRepository repository, String context) -
readRepos
-
addRepo
-
getTrackingFile
-
getKey
-
isTracked
-