org.repoweb.model.file
Class FileRepository

java.lang.Object
  extended byorg.repoweb.model.file.FileRepository
All Implemented Interfaces:
Repository

public class FileRepository
extends java.lang.Object
implements Repository

Represent a maven repository accessed trought file.


Constructor Summary
FileRepository(java.io.File root)
           
FileRepository(java.lang.String root)
           
 
Method Summary
 Artifact buildPom(Project project)
          Build a new POM in the repository.
 ArtifactList findArtifactByClass(java.lang.String fullClassName)
          Search Artifacts that contains a class.
 ArtifactList findArtifacts(java.lang.String groupId, java.lang.String typeId, java.lang.String filename)
          Search for Artifacts.
 GroupList findGroups(java.lang.String pattern)
          Search groups that have a groupId that match pattern.
 GroupList getAllGroups()
          Get alll groups of this repository.
 Artifact getArtifact(java.lang.String groupId, java.lang.String typeId, java.lang.String filename)
          Get one Artifact.
 Group getGroup(java.lang.String groupId)
          Get a group from this repository.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FileRepository

public FileRepository(java.lang.String root)
               throws BadRepositoryLocationException

FileRepository

public FileRepository(java.io.File root)
               throws BadRepositoryLocationException
Method Detail

toString

public java.lang.String toString()

getGroup

public Group getGroup(java.lang.String groupId)
               throws UnknownGroupIdException
Description copied from interface: Repository
Get a group from this repository.

Specified by:
getGroup in interface Repository
Parameters:
groupId - group Id.
Returns:
One group.
Throws:
UnknownGroupIdException - group Id does not exist in the repo.

findGroups

public GroupList findGroups(java.lang.String pattern)
Description copied from interface: Repository
Search groups that have a groupId that match pattern.

Specified by:
findGroups in interface Repository
Parameters:
pattern - pattern for search
Returns:
List of groups.

findArtifacts

public ArtifactList findArtifacts(java.lang.String groupId,
                                  java.lang.String typeId,
                                  java.lang.String filename)
Description copied from interface: Repository
Search for Artifacts.

Specified by:
findArtifacts in interface Repository
Parameters:
groupId - Group Id of the artifact (e.g. 'junit')
typeId - Artifact type (e.g. 'jar')
filename - Artifact file name (e.g. 'junit-3.8.1.jar')
Returns:
an Artifact.

findArtifactByClass

public ArtifactList findArtifactByClass(java.lang.String fullClassName)
Description copied from interface: Repository
Search Artifacts that contains a class.

Specified by:
findArtifactByClass in interface Repository
Parameters:
fullClassName - full qualified class name
Returns:
List of artifacts containing the searched class.

buildPom

public Artifact buildPom(Project project)
                  throws BuildFailureException
Description copied from interface: Repository
Build a new POM in the repository.

Specified by:
buildPom in interface Repository
Parameters:
project - the bean of the POM.
Returns:
the Artifact that represent the POM.
Throws:
BuildFailureException - Failed to build the POM.

getArtifact

public Artifact getArtifact(java.lang.String groupId,
                            java.lang.String typeId,
                            java.lang.String filename)
                     throws UnknownArtifactException
Description copied from interface: Repository
Get one Artifact.

Specified by:
getArtifact in interface Repository
Parameters:
groupId - Group Id of the artifact (e.g. 'junit')
typeId - Artifact type (e.g. 'jar')
filename - Artifact file name (e.g. 'junit-3.8.1.jar')
Returns:
an Artifact.
Throws:
UnknownArtifactException - artifact do not exist in the repo.

getAllGroups

public GroupList getAllGroups()
Description copied from interface: Repository
Get alll groups of this repository.

Specified by:
getAllGroups in interface Repository
Returns:
List of groups.


Copyright © 2003-2005 Repoweb. All Rights Reserved.