blob: 21e4f8b481c7f0b29a98db43ab9b65f6f1cc757c [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.spi.p2.artifact.repository;
import java.net.URL;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepository;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
public interface IArtifactRepositoryFactory {
/**
* Creates and returns a new empty artifact repository of the given type at
* the given location.
*
* @param location the location for the new repository
* @param name the name of the new repository
* @param type the kind of repository to create
* @return the newly created repository
* @throws ProvisionException if the repository could not be created. Reasons include:
* <ul>
* <li>The repository type is unknown.</li>
* <li>There was an error writing to the given repository location.</li>
* <li>A repository already exists at that location.</li>
* </ul>
*/
public IArtifactRepository create(URL location, String name, String type) throws ProvisionException;
/**
* Loads the repository at the given location. The location is expected to contain
* data that describes a valid artifact repository of a known type. If this manager
* already knows a repository at the given location then that repository is returned.
*
* @param location the location in which to look for a repository description
* @param monitor a progress monitor, or <code>null</code> if progress
* reporting is not desired
* @return a repository object for the given location
* @throws ProvisionException if the repository could not be created. Reasons include:
* <ul>
* <li>There is no existing repository at that location.</li>
* <li>The repository at that location could not be read.</li>
* </ul>
*/
public IArtifactRepository load(URL location, IProgressMonitor monitor) throws ProvisionException;
}