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:
  • Field Details

  • Constructor Details

  • Method Details

    • concatPaths

      private String concatPaths(String prefix, String artifactPath)
    • getPathForLocalArtifact

      public String getPathForLocalArtifact(Artifact artifact)
      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 interface LocalRepositoryManager
      Overrides:
      getPathForLocalArtifact in class SimpleLocalRepositoryManager
      Parameters:
      artifact - The artifact for which to determine the path, must not be null.
      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 interface LocalRepositoryManager
      Overrides:
      getPathForRemoteArtifact in class SimpleLocalRepositoryManager
      Parameters:
      artifact - The artifact for which to determine the path, must not be null.
      repository - The source repository of the artifact, must not be null.
      context - The resolution context in which the artifact is being requested, may be null.
      Returns:
      The path, relative to the local repository's base directory.
    • getPathForLocalMetadata

      public String getPathForLocalMetadata(Metadata metadata)
      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 interface LocalRepositoryManager
      Overrides:
      getPathForLocalMetadata in class SimpleLocalRepositoryManager
      Parameters:
      metadata - The metadata for which to determine the path, must not be null.
      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 interface LocalRepositoryManager
      Overrides:
      getPathForRemoteMetadata in class SimpleLocalRepositoryManager
      Parameters:
      metadata - The metadata for which to determine the path, must not be null.
      repository - The source repository of the metadata, must not be null.
      context - The resolution context in which the metadata is being requested, may be null.
      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 interface LocalRepositoryManager
      Overrides:
      find in class SimpleLocalRepositoryManager
      Parameters:
      session - The repository system session during which the request is made, must not be null.
      request - The artifact request, must not be null.
      Returns:
      The result of the request, never null.
    • checkFind

      private void checkFind(File file, LocalArtifactResult result)
    • 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 interface LocalRepositoryManager
      Overrides:
      add in class SimpleLocalRepositoryManager
      Parameters:
      session - The repository system session during which the registration is made, must not be null.
      request - The registration request, must not be null.
    • getRepositoryKeys

      private Collection<String> getRepositoryKeys(RemoteRepository repository, Collection<String> contexts)
    • addArtifact

      private void addArtifact(Artifact artifact, Collection<String> repositories, RemoteRepository repository, String context)
    • readRepos

      private Properties readRepos(File artifactFile)
    • addRepo

      private void addRepo(File artifactFile, Collection<String> repositories)
    • getTrackingFile

      private File getTrackingFile(File artifactFile)
    • getKey

      private String getKey(File file, String repository)
    • isTracked

      private boolean isTracked(Properties props, File file)