blob: 819f39e80b56161cc7ab5ac4c55c88b4950917cf [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2007, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.equinox.internal.provisional.p2.ui.operations;
import java.net.URI;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
/**
* Operation which adds an artifact repository given its URL.
*
* @since 3.4
*/
public class AddArtifactRepositoryOperation extends RepositoryOperation {
public AddArtifactRepositoryOperation(String label, URI location) {
super(label, new URI[] {location});
}
protected IStatus doBatchedExecute(IProgressMonitor monitor) throws ProvisionException {
SubMonitor mon = SubMonitor.convert(monitor, locations.length);
for (int i = 0; i < locations.length; i++) {
ProvisioningUtil.addArtifactRepository(locations[i], notify);
mon.worked(1);
}
return okStatus();
}
}