Here you can find the source of getJarredPluginPath(String bundleId)
Parameter | Description |
---|---|
bundleId | a parameter |
static public IPath getJarredPluginPath(String bundleId)
//package com.java2s; /******************************************************************************* * Copyright (c) 2003, 2012 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://from w w w . ja v a2 s .c o m * IBM Corporation - initial API and implementation * yyyymmdd bug Email and other contact information * -------- -------- ----------------------------------------------------------- * 20070501 184505 kathy@ca.ibm.com - Kathy Chan * 20080326 224148 makandre@ca.ibm.com - Andrew Mak, Web service scenarios broke in latest builds with Equinox p2 * 20120418 364026 lippert@acm.org - Martin Lippert, saaj.jar deployment fails when multiple javax.xml.soap bundles are installed *******************************************************************************/ import java.io.File; import java.io.IOException; import org.eclipse.core.runtime.FileLocator; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Platform; import org.osgi.framework.Bundle; public class Main { /** * @param bundleId * @return Returns the path for the Jarred plugin. Returns null if path not found. */ static public IPath getJarredPluginPath(String bundleId) { IPath result = null; Bundle bundle = Platform.getBundle(bundleId); if (bundle != null) { try { File file = FileLocator.getBundleFile(bundle); result = new Path(file.getCanonicalPath()); } catch (IOException e) { // ignore, return null } } return result; } }