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 Stringprivate final LocalPathPrefixComposerprivate final TrackingFileManagerprivate final String -
Constructor Summary
ConstructorsConstructorDescriptionEnhancedLocalRepositoryManager(File basedir, LocalPathComposer localPathComposer, String trackingFilename, TrackingFileManager trackingFileManager, LocalPathPrefixComposer localPathPrefixComposer) -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(RepositorySystemSession session, LocalArtifactRegistration request) Registers an installed or resolved artifact with the local repository.private voidaddArtifact(Artifact artifact, Collection<String> repositories, RemoteRepository repository, String context) private voidaddRepo(File artifactFile, Collection<String> repositories) private voidcheckFind(File file, LocalArtifactResult result) private StringconcatPaths(String prefix, String artifactPath) find(RepositorySystemSession session, LocalArtifactRequest request) Queries for the existence of an artifact in the local repository.private StringgetPathForLocalArtifact(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 FilegetTrackingFile(File artifactFile) private booleanisTracked(Properties props, File file) private PropertiesMethods 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: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- Overrides:
getPathForLocalArtifactin 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: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- Overrides:
getPathForRemoteArtifactin 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: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- Overrides:
getPathForLocalMetadatain 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: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- Overrides:
getPathForRemoteMetadatain 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: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- Overrides:
findin 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: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- Overrides:
addin 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
-