private String getNoPomArtifactRepoId( String principal, List<String> observableRepos, String groupId,
String artifactId, String version, String repositoryId )
throws ObjectNotFoundException, ArchivaDatabaseException
{
ArchivaArtifact artifact = null;
String type = getArtifactType( groupId, artifactId, version );
artifact = dao.getArtifactDAO().createArtifact( groupId, artifactId, version, null, type, repositoryId );
if ( artifact == null )
{
// Lets not persist these
artifact = new ArchivaArtifact( groupId, artifactId, version, null, type, repositoryId );
}
// Allowed to see this?
if ( !observableRepos.contains( artifact.getModel().getRepositoryId() ) )
{
throw new ObjectNotFoundException( "Unable to find artifact " + Keys.toKey( groupId, artifactId, version ) +
" in observable repository [" + StringUtils.join( observableRepos.iterator(), ", " ) + "] for user " +
principal );
}
return artifact.getModel().getRepositoryId();
}