|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.taverna.raven.repository.impl.LocalRepository
public class LocalRepository
Represents the state of a local Maven2 repository on disk. Manages the queue of pending fetches. Create an instance of this class using the static getRepository(File base) method passing it the location of the on disk maven2 repository to access or create.
Method Summary | |
---|---|
void |
addArtifact(Artifact a1)
Add a new artifact to this repository. |
void |
addRemoteRepository(java.net.URL repositoryURL)
Add a reference to a remote repository to be used to fetch pom and jar files. |
void |
addRepositoryListener(RepositoryListener l)
Add a new repository listener to be notified of status changes within this Repository implementation |
Artifact |
artifactForClass(java.lang.Class<?> c)
Given a Class object return the Artifact whose LocalArtifactClassLoader created it. |
void |
clean()
Clean the local repository by removing invalid artifacts and directories. |
java.util.List<Artifact> |
getArtifacts()
Return all Artifacts within this repository |
java.util.List<Artifact> |
getArtifacts(ArtifactStatus s)
Return all artifacts with the specified ArtifactStatus |
DownloadStatus |
getDownloadStatus(Artifact a)
If the artifact specified is in either PomFetching or JarFetching state this returns a DownloadStatus object which provides a non updating snapshot of the file size (if known) and total bytes downloaded. |
java.lang.ClassLoader |
getLoader(Artifact a1,
java.lang.ClassLoader parent)
Get a ClassLoader for the specified artifact |
static Repository |
getRepository(java.io.File base)
Get a new or cached instance of LocalRepository for the supplied base directory, this is the method to use when you want to get hold of a Repository. |
static Repository |
getRepository(java.io.File base,
java.lang.ClassLoader loader,
java.util.Set<Artifact> systemArtifacts)
Get a new or cached instance of LocalRepository. |
ArtifactStatus |
getStatus(Artifact a)
Status for a given Artifact |
java.io.File |
jarFile(Artifact a)
File object for JAR for the specified artifact. |
void |
prependRemoteRepository(java.net.URL repositoryURL)
Adds a remote repository, but adds it at the start of the list. |
void |
removeRepositoryListener(RepositoryListener l)
Remove a listener from the list of interested observers |
java.lang.String |
toString()
|
void |
update()
Scan the status table, perform actions on each item based on the status. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static Repository getRepository(java.io.File base)
base
- The base directory for the m2 repository on disk
public static Repository getRepository(java.io.File base, java.lang.ClassLoader loader, java.util.Set<Artifact> systemArtifacts)
public void addArtifact(Artifact a1)
Repository
addArtifact
in interface Repository
a1
- Artifact to query statuspublic void addRemoteRepository(java.net.URL repositoryURL)
Repository
addRemoteRepository
in interface Repository
public void addRepositoryListener(RepositoryListener l)
addRepositoryListener
in interface Repository
public Artifact artifactForClass(java.lang.Class<?> c) throws ArtifactNotFoundException
artifactForClass
in interface Repository
ArtifactNotFoundException
public void clean()
Empty directories will always be removed.
public java.util.List<Artifact> getArtifacts()
getArtifacts
in interface Repository
public java.util.List<Artifact> getArtifacts(ArtifactStatus s)
getArtifacts
in interface Repository
public DownloadStatus getDownloadStatus(Artifact a) throws ArtifactStateException, ArtifactNotFoundException
getDownloadStatus
in interface Repository
a
- Artifact to get status for
ArtifactNotFoundException
- if this repository doesn't contain the specified artifact.
ArtifactStateException
- if the artifact is found but isn't involved in a download at
the present time.public java.lang.ClassLoader getLoader(Artifact a1, java.lang.ClassLoader parent) throws ArtifactNotFoundException, ArtifactStateException
Repository
getLoader
in interface Repository
a1
- The artifact to set up the classloader forparent
- Optional parent ClassLoader, may be null for no parent
ArtifactNotFoundException
ArtifactStateException
public ArtifactStatus getStatus(Artifact a)
getStatus
in interface Repository
a
- Artifact to get status for
public java.io.File jarFile(Artifact a)
#artifactDir(Artifact)
as it could have been found in
a local repository by fetchLocal(ArtifactImpl, String)
.
public void prependRemoteRepository(java.net.URL repositoryURL)
repositoryURL
- public void removeRepositoryListener(RepositoryListener l)
Repository
removeRepositoryListener
in interface Repository
public java.lang.String toString()
toString
in class java.lang.Object
public void update()
Repository
update
in interface Repository
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |