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
class EnhancedLocalRepositoryManager extends SimpleLocalRepositoryManager
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:
EnhancedLocalRepositoryManagerFactory
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
LOCAL_REPO_ID
private TrackingFileManager
trackingFileManager
private java.lang.String
trackingFilename
-
Constructor Summary
Constructors Constructor Description EnhancedLocalRepositoryManager(java.io.File basedir, RepositorySystemSession session)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(RepositorySystemSession session, LocalArtifactRegistration request)
Registers an installed or resolved artifact with the local repository.private void
addArtifact(Artifact artifact, java.util.Collection<java.lang.String> repositories, boolean local)
private void
addRepo(java.io.File artifactFile, java.util.Collection<java.lang.String> repositories)
LocalArtifactResult
find(RepositorySystemSession session, LocalArtifactRequest request)
Queries for the existence of an artifact in the local repository.private java.lang.String
getKey(java.io.File file, java.lang.String repository)
private java.util.Collection<java.lang.String>
getRepositoryKeys(RemoteRepository repository, java.util.Collection<java.lang.String> contexts)
private java.io.File
getTrackingFile(java.io.File artifactFile)
private boolean
isTracked(java.util.Properties props, java.io.File file)
private java.util.Properties
readRepos(java.io.File artifactFile)
-
Methods inherited from class org.eclipse.aether.internal.impl.SimpleLocalRepositoryManager
add, find, getPathForArtifact, getPathForLocalArtifact, getPathForLocalMetadata, getPathForRemoteArtifact, getPathForRemoteMetadata, getRepository, getRepositoryKey, toString
-
-
-
-
Field Detail
-
LOCAL_REPO_ID
private static final java.lang.String LOCAL_REPO_ID
- See Also:
- Constant Field Values
-
trackingFilename
private final java.lang.String trackingFilename
-
trackingFileManager
private final TrackingFileManager trackingFileManager
-
-
Constructor Detail
-
EnhancedLocalRepositoryManager
EnhancedLocalRepositoryManager(java.io.File basedir, RepositorySystemSession session)
-
-
Method Detail
-
find
public LocalArtifactResult find(RepositorySystemSession session, LocalArtifactRequest request)
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
.
-
add
public void add(RepositorySystemSession session, LocalArtifactRegistration request)
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 java.util.Collection<java.lang.String> getRepositoryKeys(RemoteRepository repository, java.util.Collection<java.lang.String> contexts)
-
addArtifact
private void addArtifact(Artifact artifact, java.util.Collection<java.lang.String> repositories, boolean local)
-
readRepos
private java.util.Properties readRepos(java.io.File artifactFile)
-
addRepo
private void addRepo(java.io.File artifactFile, java.util.Collection<java.lang.String> repositories)
-
getTrackingFile
private java.io.File getTrackingFile(java.io.File artifactFile)
-
getKey
private java.lang.String getKey(java.io.File file, java.lang.String repository)
-
isTracked
private boolean isTracked(java.util.Properties props, java.io.File file)
-
-