Class FileSystemArtifactRepository
- java.lang.Object
-
- org.guvnor.m2repo.backend.server.repositories.FileSystemArtifactRepository
-
- All Implemented Interfaces:
ArtifactRepository
public class FileSystemArtifactRepository extends Object implements ArtifactRepository
-
-
Constructor Summary
Constructors Constructor Description FileSystemArtifactRepository()FileSystemArtifactRepository(String name, String dir)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsArtifact(org.guvnor.common.services.project.model.GAV gav)Checks whether this Maven repository contains the specified artifact (GAV).voiddelete(org.guvnor.common.services.project.model.GAV gav)Delete an artifact from the repositoryvoiddeploy(String pom, org.eclipse.aether.artifact.Artifact... artifacts)Deploy a list of artifact into a repositoryFilegetArtifactFileFromRepository(org.guvnor.common.services.project.model.GAV gav)Return an artifact from the repositoryStringgetName()Returns the name of the repository, an identifierprotected org.eclipse.aether.repository.RemoteRepositorygetRepository()StringgetRootDir()Return the root dir of a repository, if it doesn't have one, return nullbooleanisPomRepository()Identifies if is a repository that admit pom artifactsbooleanisRepository()Identifies if is a repository that admit artifactsCollection<org.eclipse.aether.artifact.Artifact>listArtifacts(List<String> wildcards)List repository artifacts filtered by wildcardsCollection<File>listFiles(List<String> wildcards)List repository files filtered by wildcards
-
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:ArtifactRepositoryReturns the name of the repository, an identifier- Specified by:
getNamein interfaceArtifactRepository- Returns:
- the name
-
getRootDir
public String getRootDir()
Description copied from interface:ArtifactRepositoryReturn the root dir of a repository, if it doesn't have one, return null- Specified by:
getRootDirin interfaceArtifactRepository- Returns:
- the root dir of a repository.
-
listFiles
public Collection<File> listFiles(List<String> wildcards)
Description copied from interface:ArtifactRepositoryList repository files filtered by wildcards- Specified by:
listFilesin interfaceArtifactRepository- Parameters:
wildcards- the filtering wildcards- Returns:
- the files
-
listArtifacts
public Collection<org.eclipse.aether.artifact.Artifact> listArtifacts(List<String> wildcards)
Description copied from interface:ArtifactRepositoryList repository artifacts filtered by wildcards- Specified by:
listArtifactsin interfaceArtifactRepository- Parameters:
wildcards- the filtering wildcards- Returns:
- the artifacts
-
containsArtifact
public boolean containsArtifact(org.guvnor.common.services.project.model.GAV gav)
Description copied from interface:ArtifactRepositoryChecks whether this Maven repository contains the specified artifact (GAV).As opposed to ${code
ArtifactRepository.getArtifactFileFromRepository(GAV)}, this method will not log any WARNings in case the artifact is not present (the Aether exception is only logged as TRACE message).- Specified by:
containsArtifactin interfaceArtifactRepository- Parameters:
gav- artifact GAV, never null- Returns:
- true if the this Maven repo contains the specified artifact, otherwise false
-
getArtifactFileFromRepository
public File getArtifactFileFromRepository(org.guvnor.common.services.project.model.GAV gav)
Description copied from interface:ArtifactRepositoryReturn an artifact from the repository- Specified by:
getArtifactFileFromRepositoryin interfaceArtifactRepository- Parameters:
gav- the GAV identifier- Returns:
- the artifact found
-
isRepository
public boolean isRepository()
Description copied from interface:ArtifactRepositoryIdentifies if is a repository that admit artifacts- Specified by:
isRepositoryin interfaceArtifactRepository- Returns:
-
isPomRepository
public boolean isPomRepository()
Description copied from interface:ArtifactRepositoryIdentifies if is a repository that admit pom artifacts- Specified by:
isPomRepositoryin interfaceArtifactRepository- Returns:
-
deploy
public void deploy(String pom, org.eclipse.aether.artifact.Artifact... artifacts)
Description copied from interface:ArtifactRepositoryDeploy a list of artifact into a repository- Specified by:
deployin interfaceArtifactRepository- Parameters:
pom- the artifact pomartifacts- the list of artifacts
-
delete
public void delete(org.guvnor.common.services.project.model.GAV gav)
Description copied from interface:ArtifactRepositoryDelete an artifact from the repository- Specified by:
deletein interfaceArtifactRepository- Parameters:
gav- the GAV identifier of the artifact to be deleted
-
getRepository
protected org.eclipse.aether.repository.RemoteRepository getRepository()
-
-