org.sonatype.aether.impl.internal
Class SimpleLocalRepositoryManager

java.lang.Object
  extended by org.sonatype.aether.impl.internal.SimpleLocalRepositoryManager
All Implemented Interfaces:
LocalRepositoryManager
Direct Known Subclasses:
EnhancedLocalRepositoryManager

public class SimpleLocalRepositoryManager
extends java.lang.Object
implements LocalRepositoryManager

A local repository manager that realizes the classical Maven 2.0 local repository.

Author:
Benjamin Bentmann

Constructor Summary
SimpleLocalRepositoryManager(java.io.File basedir)
           
SimpleLocalRepositoryManager(java.lang.String basedir)
           
 
Method Summary
 void add(RepositorySystemSession session, LocalArtifactRegistration request)
          Registers an installed or resolved artifact with the local repository.
 LocalArtifactResult find(RepositorySystemSession session, LocalArtifactRequest request)
          Queries for the existence of an artifact in the local repository.
 java.lang.String getPathForLocalArtifact(Artifact artifact)
          Gets the relative path for a locally built artifact.
 java.lang.String getPathForLocalMetadata(Metadata metadata)
          Gets the relative path for locally built metadata.
 java.lang.String getPathForRemoteArtifact(Artifact artifact, RemoteRepository repository, java.lang.String context)
          Gets the relative path for an artifact cached from a remote repository.
 java.lang.String getPathForRemoteMetadata(Metadata metadata, RemoteRepository repository, java.lang.String context)
          Gets the relative path for metadata cached from a remote repository.
 LocalRepository getRepository()
          Gets the description of the local repository being managed.
 SimpleLocalRepositoryManager setLogger(Logger logger)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleLocalRepositoryManager

public SimpleLocalRepositoryManager(java.io.File basedir)

SimpleLocalRepositoryManager

public SimpleLocalRepositoryManager(java.lang.String basedir)
Method Detail

setLogger

public SimpleLocalRepositoryManager setLogger(Logger logger)

getRepository

public LocalRepository getRepository()
Description copied from interface: LocalRepositoryManager
Gets the description of the local repository being managed.

Specified by:
getRepository in interface LocalRepositoryManager
Returns:
The description of the local repository, never null.

getPathForLocalArtifact

public java.lang.String getPathForLocalArtifact(Artifact artifact)
Description copied from interface: LocalRepositoryManager
Gets the relative path for a locally built artifact. Note that the artifact need not actually exist yet at the returned location. The path uses the forward slash as directory separator regardless of the underlying file system.

Specified by:
getPathForLocalArtifact in interface LocalRepositoryManager
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 java.lang.String getPathForRemoteArtifact(Artifact artifact,
                                                 RemoteRepository repository,
                                                 java.lang.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 uses the forward slash as directory separator regardless of the underlying file system.

Specified by:
getPathForRemoteArtifact in interface LocalRepositoryManager
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 java.lang.String getPathForLocalMetadata(Metadata metadata)
Description copied from interface: LocalRepositoryManager
Gets the relative path for locally built metadata. Note that the metadata need not actually exist yet at the returned location. The path uses the forward slash as directory separator regardless of the underlying file system.

Specified by:
getPathForLocalMetadata in interface LocalRepositoryManager
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 java.lang.String getPathForRemoteMetadata(Metadata metadata,
                                                 RemoteRepository repository,
                                                 java.lang.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 uses the forward slash as directory separator regardless of the underlying file system.

Specified by:
getPathForRemoteMetadata in interface LocalRepositoryManager
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

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 built artifact or a previously downloaded artifact.

Specified by:
find in interface LocalRepositoryManager
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.

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
Parameters:
session - The repository system session during which the registration is made, must not be null.
request - The registration request, must not be null.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2010 Sonatype, Inc.. All Rights Reserved.