Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2008, 2010 Code 9 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: Code 9 - initial API and implementation IBM - ongoing development /
 
 package org.eclipse.equinox.internal.p2.updatesite;
 
 import java.io.File;
 import  org.eclipse.equinox.p2.publisher.eclipse.BundlesAction;
 import  org.eclipse.equinox.p2.publisher.eclipse.FeaturesAction;
A publishing action that processes a local (File-based) update site and generates metadata and artifacts for the features, bundles and site index (categories etc).
 
 public class LocalUpdateSiteAction implements IPublisherAction {
 	protected String source;
 	private UpdateSite updateSite;
 
 	protected LocalUpdateSiteAction() {
 		// empty
 	}

Creates a local updatesite publisher action from a source location

Parameters:
source The location of the directory that contains the site.xml file
categoryQualifier The qualifier to prepend to categories. This qualifier is used to ensure that the category IDs are unique between update sites. If null a default qualifier will be generated
 
 	public LocalUpdateSiteAction(String sourceString categoryQualifier) {
 		this. = source;
 		this. = categoryQualifier;
 	}

Creates a local updatesite publisher action from an UpdateSite

Parameters:
updateSite The updatesite to use
categoryQualifier The qualifier to prepend to categories. This qualifier is used to ensure that the category IDs are unique between update sites. If null a default qualifier will be generated
 
 	public LocalUpdateSiteAction(UpdateSite updateSiteString categoryQualifier) {
 		this. = updateSite;
 		this. = categoryQualifier;
 	}
 
 	public void setCategoryVersion(String version) {
 		 = version;
 	}
 
 	public IStatus perform(IPublisherInfo infoIPublisherResult resultsIProgressMonitor monitor) {
 		IPublisherAction[] actions = createActions();
 		MultiStatus finalStatus = new MultiStatus(LocalUpdateSiteAction.class.getName(), 0, NLS.bind(. != null ?  : ( != null ? .getLocation().toString() : "Unknown")), null); //$NON-NLS-1$
 		for (int i = 0; i < actions.lengthi++) {
 			if (monitor.isCanceled())
 			finalStatus.merge(actions[i].perform(inforesultsmonitor));
 		}
 		if (!finalStatus.isOK())
 			return finalStatus;
 		return .;
 	}
 
 	protected IPublisherAction[] createActions() {
 		// create an action that just publishes the raw bundles and features
 		result.add(action);
 		return result.toArray(new IPublisherAction[result.size()]);
 	}
 
 		SiteXMLAction action = null;
 		if ( != null)
 		else if ( != null) {
 			action = new SiteXMLAction(new File("site.xml").toURI(), ); //$NON-NLS-1$
 		}
 		if (action != null &&  != null)
 		return action;
 	}
 
 	private void createAdvice() {
		// empty
	}
		return new FeaturesAction(new File[] {new File("features")}); //$NON-NLS-1$
	}
		return new BundlesAction(new File[] {new File("plugins")}); //$NON-NLS-1$
	}
New to GrepCode? Check out our FAQ X