Java SOAP Message getJarredPluginPath(String bundleId)

Here you can find the source of getJarredPluginPath(String bundleId)

Description

get Jarred Plugin Path

License

Open Source License

Parameter

Parameter Description
bundleId a parameter

Return

Returns the path for the Jarred plugin. Returns null if path not found.

Declaration

static public IPath getJarredPluginPath(String bundleId) 

Method Source Code

//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;
    }
}

Related

  1. getBytes(SOAPMessage soap)
  2. getDeclaredNamespaces(SOAPElement aElement, Map aPrefixMap)
  3. getExcludedTypes()
  4. getFaultCodeAndString(SOAPMessage message)
  5. getHeaderValue(SOAPMessage message, String tagName)
  6. getNamespaceDeclarations(SOAPEnvelope env, SOAPBodyElement body)
  7. getNamespacePrefix(SOAPElement element, String nsURI)
  8. getNamespacePrefixes(SOAPElement element)
  9. getNamespaceURIs(SOAPMessage soap)