Java Jar Manifest getBundleClassPath(Manifest manifest)

Here you can find the source of getBundleClassPath(Manifest manifest)

Description

get Bundle Class Path

License

Open Source License

Declaration

public static String[] getBundleClassPath(Manifest manifest) 

Method Source Code

//package com.java2s;
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt

import java.util.ArrayList;
import java.util.List;
import java.util.jar.Attributes;

import java.util.jar.Manifest;

public class Main {
    public static String[] getBundleClassPath(Manifest manifest) {
        if (manifest == null) {
            return new String[0];
        }/*from w w w. j  av  a2 s  . co m*/
        Attributes mainAttributes = manifest.getMainAttributes();
        if (mainAttributes == null) {
            return new String[0];
        }

        String value = mainAttributes.getValue("Bundle-ClassPath"); //$NON-NLS-1$
        if (value == null) {
            return new String[0];
        }

        List<String> bundleCPs = new ArrayList<String>();
        final String[] entries = value.split(","); //$NON-NLS-1$
        for (String entry : entries) {
            bundleCPs.add(entry);
        }
        return bundleCPs.toArray(new String[0]);
    }
}

Related

  1. createTestManifest(Attributes.Name name, String value)
  2. formatDisplay(String src, Manifest manifest)
  3. generateEmptyManifest()
  4. getAttribute(final Manifest manifest, final String name, final String defValue)
  5. getAttribute(String attributeName, Manifest manifest)
  6. getBundleVersion(Manifest manifest)
  7. getHeader(String name, Manifest manifest)
  8. getMainAttributeValue(Manifest manifest, String attribute)
  9. getManifest()