import org.apache.archiva.admin.model.beans.ManagedRepository;
import org.apache.archiva.maven2.model.Artifact;
import org.apache.archiva.maven2.model.TreeEntry;
+import org.apache.archiva.metadata.model.ArtifactMetadata;
import org.apache.archiva.metadata.model.ProjectVersionMetadata;
import org.apache.archiva.redback.authorization.RedbackAuthorization;
import org.apache.archiva.rest.api.model.ArtifactContent;
@PathParam ("v") String version, @QueryParam ("repositoryId") String repositoryId )
throws ArchivaRestServiceException;
- @Path ("artifactsNumber/{r}")
+ @Path ("artifacts/{r}")
@GET
@Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
@RedbackAuthorization (noPermission = true, noRestriction = true)
/**
*
- * return artifacts number in a repository
+ * return List of all artifacts from this repository
* @param repositoryId
* @return
* @throws ArchivaRestServiceException
* @since 1.4-M3
*/
- Integer getArtifactsNumber( @PathParam ( "r" ) String repositoryId )
+ List<Artifact> getArtifacts( @PathParam ( "r" ) String repositoryId )
throws ArchivaRestServiceException;
}
return false;
}
- public Integer getArtifactsNumber( String repositoryId )
+ public List<Artifact> getArtifacts( String repositoryId )
throws ArchivaRestServiceException
{
RepositorySession repositorySession = repositorySessionFactory.createSession();
try
{
- return repositorySession.getRepository().getArtifacts( repositoryId ).size();
+ List<ArtifactMetadata> artifactMetadatas = repositorySession.getRepository().getArtifacts( repositoryId );
+ return buildArtifacts( artifactMetadatas, repositoryId );
}
catch ( MetadataRepositoryException e )
{