use of org.eclipse.equinox.p2.repository.artifact.IArtifactRepository in project tycho by eclipse.
the class VerifierServiceImpl method verifyReferencedArtifactsExist.
private boolean verifyReferencedArtifactsExist(final IMetadataRepository metadata, final IArtifactRepository artifactRepository, MavenLogger logger) {
final IQueryResult<IInstallableUnit> collector = metadata.query(QueryUtil.ALL_UNITS, monitor);
boolean valid = true;
for (Iterator<IInstallableUnit> iterator = collector.iterator(); iterator.hasNext(); ) {
IInstallableUnit iu = iterator.next();
final Collection<IArtifactKey> artifacts = iu.getArtifacts();
for (IArtifactKey key : artifacts) {
valid &= verifyArtifactExists(key, artifactRepository, logger);
}
}
return valid;
}
use of org.eclipse.equinox.p2.repository.artifact.IArtifactRepository in project tycho by eclipse.
the class VerifierServiceImpl method verify.
@Override
public boolean verify(URI metadataRepositoryUri, URI artifactRepositoryUri, BuildOutputDirectory tempDirectory) throws FacadeException {
MavenLogger logger = mavenContext.getLogger();
logger.debug("Checking metadata from '" + metadataRepositoryUri + "' and artifacts from '" + artifactRepositoryUri + "'");
IProvisioningAgent agent = Activator.createProvisioningAgent(tempDirectory);
try {
try {
final IMetadataRepository metadata = loadMetadataRepository(metadataRepositoryUri, agent);
final IArtifactRepository artifactRepository = loadArtifactRepository(artifactRepositoryUri, agent);
boolean valid = true;
valid &= verifyReferencedArtifactsExist(metadata, artifactRepository, logger);
valid &= verifyAllArtifactContent(artifactRepository, logger);
if (valid) {
logger.info("The integrity of the metadata repository '" + metadataRepositoryUri + "' and artifact repository '" + artifactRepositoryUri + "' has been verified successfully");
}
return valid;
} catch (ProvisionException e) {
throw new FacadeException(e);
}
} finally {
agent.stop();
}
}
Aggregations