Search in sources :

Example 1 with RecreateRepositoryApplication

use of org.eclipse.equinox.p2.internal.repository.tools.RecreateRepositoryApplication in project tycho by eclipse.

the class MirrorApplicationServiceImpl method recreateArtifactRepository.

private void recreateArtifactRepository(DestinationRepositoryDescriptor destination) throws FacadeException {
    // create the missing md5 checksums
    if (destination.isMetaDataOnly()) {
        return;
    }
    RepositoryDescriptor descriptor = new RepositoryDescriptor();
    descriptor.setAppend(true);
    descriptor.setFormat(null);
    // $NON-NLS-1$
    descriptor.setKind("artifact");
    descriptor.setLocation(destination.getLocation().toURI());
    RecreateRepositoryApplication application = new RecreateRepositoryApplication();
    application.setArtifactRepository(descriptor);
    try {
        application.run(new NullProgressMonitor());
    } catch (ProvisionException e) {
        throw new FacadeException("Recreate artifact repository failed", e);
    }
}
Also used : FacadeException(org.eclipse.tycho.p2.tools.FacadeException) DestinationRepositoryDescriptor(org.eclipse.tycho.p2.tools.DestinationRepositoryDescriptor) RepositoryDescriptor(org.eclipse.equinox.p2.internal.repository.tools.RepositoryDescriptor) NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) ProvisionException(org.eclipse.equinox.p2.core.ProvisionException) RecreateRepositoryApplication(org.eclipse.equinox.p2.internal.repository.tools.RecreateRepositoryApplication)

Aggregations

NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)1 ProvisionException (org.eclipse.equinox.p2.core.ProvisionException)1 RecreateRepositoryApplication (org.eclipse.equinox.p2.internal.repository.tools.RecreateRepositoryApplication)1 RepositoryDescriptor (org.eclipse.equinox.p2.internal.repository.tools.RepositoryDescriptor)1 DestinationRepositoryDescriptor (org.eclipse.tycho.p2.tools.DestinationRepositoryDescriptor)1 FacadeException (org.eclipse.tycho.p2.tools.FacadeException)1