Package org.eclipse.osgi.util

Examples of org.eclipse.osgi.util.ManifestElement


    String tag = GENERATED_FROM + ": "; //$NON-NLS-1$
    if (secondLine == null || !secondLine.startsWith(tag))
      return false;

    secondLine = secondLine.substring(tag.length());
    ManifestElement generatedFrom;
    try {
      generatedFrom = ManifestElement.parseHeader(PluginConverterImpl.GENERATED_FROM, secondLine)[0];
    } catch (BundleException be) {
      return false;
    }
    String timestampStr = generatedFrom.getValue();
    try {
      return Long.parseLong(timestampStr.trim()) == getTimeStamp(pluginLocation, manifestType);
    } catch (NumberFormatException nfe) {
      // not a big deal - just a bogus existing manifest that will be ignored
    }
View Full Code Here


    registeredBuddyList = (String) manifest.get(Constants.REGISTERED_POLICY);
    if (hasPackageInfo(bundledata.getEntry(Constants.OSGI_BUNDLE_MANIFEST)))
      flags |= FLAG_HAS_PACKAGE_INFO;
    String genFrom = (String) manifest.get(PluginConverterImpl.GENERATED_FROM);
    if (genFrom != null) {
      ManifestElement generatedFrom = ManifestElement.parseHeader(PluginConverterImpl.GENERATED_FROM, genFrom)[0];
      if (generatedFrom != null) {
        manifestTimeStamp = Long.parseLong(generatedFrom.getValue());
        manifestType = Byte.parseByte(generatedFrom.getAttribute(PluginConverterImpl.MANIFEST_TYPE_ATTRIBUTE));
      }
    }
    if (isAutoStartable()) {
      bundledata.setStatus(bundledata.getStatus() | Constants.BUNDLE_LAZY_START);
      if (COMPATIBILITY_LAZYSTART)
View Full Code Here

    }

    //Now we know the symbolicId and the version of the bundle, we check to see if don't have a manifest for it already
    Version version = Version.parseVersion((String) generatedManifest.get(Constants.BUNDLE_VERSION));
    String symbolicName = ManifestElement.parseHeader(org.osgi.framework.Constants.BUNDLE_SYMBOLICNAME, (String) generatedManifest.get(org.osgi.framework.Constants.BUNDLE_SYMBOLICNAME))[0].getValue();
    ManifestElement generatedFrom = ManifestElement.parseHeader(PluginConverterImpl.GENERATED_FROM, (String) generatedManifest.get(PluginConverterImpl.GENERATED_FROM))[0];
    Headers existingHeaders = checkManifestAndParent(cacheLocation, symbolicName, version.toString(), Byte.parseByte(generatedFrom.getAttribute(PluginConverterImpl.MANIFEST_TYPE_ATTRIBUTE)));
    //We don't have a manifest.
    manifestTimeStamp = Long.parseLong(generatedFrom.getValue());
    manifestType = Byte.parseByte(generatedFrom.getAttribute(PluginConverterImpl.MANIFEST_TYPE_ATTRIBUTE));
    if (bundledata.getAdaptor().isReadOnly() || existingHeaders != null)
      return existingHeaders;

    //merge the original manifest with the generated one
    if (builtIn != null) {
View Full Code Here

    String tag = GENERATED_FROM + ": "; //$NON-NLS-1$
    if (secondLine == null || !secondLine.startsWith(tag))
      return false;

    secondLine = secondLine.substring(tag.length());
    ManifestElement generatedFrom;
    try {
      generatedFrom = ManifestElement.parseHeader(PluginConverterImpl.GENERATED_FROM, secondLine)[0];
    } catch (BundleException be) {
      return false;
    }
    String timestampStr = generatedFrom.getValue();
    try {
      return Long.parseLong(timestampStr.trim()) == getTimeStamp(pluginLocation, manifestType);
    } catch (NumberFormatException nfe) {
      // not a big deal - just a bogus existing manifest that will be ignored
    }
View Full Code Here

    // retrieve the symbolic-name and the singleton status
    String symbolicNameHeader = manifest.get(Constants.BUNDLE_SYMBOLICNAME);
    if (symbolicNameHeader != null) {
      ManifestElement[] symbolicNameElements = ManifestElement.parseHeader(Constants.BUNDLE_SYMBOLICNAME, symbolicNameHeader);
      if (symbolicNameElements.length > 0) {
        ManifestElement bsnElement = symbolicNameElements[0];
        result.setSymbolicName(bsnElement.getValue());
        String singleton = bsnElement.getDirective(Constants.SINGLETON_DIRECTIVE);
        if (singleton == null) // TODO this is for backward compatibility; need to check manifest version < 2 to allow this after everyone has converted to new syntax
          singleton = bsnElement.getAttribute(Constants.SINGLETON_DIRECTIVE);
        result.setStateBit(BundleDescriptionImpl.SINGLETON, "true".equals(singleton)); //$NON-NLS-1$
        String fragmentAttachment = bsnElement.getDirective(Constants.FRAGMENT_ATTACHMENT_DIRECTIVE);
        if (fragmentAttachment != null) {
          if (fragmentAttachment.equals(Constants.FRAGMENT_ATTACHMENT_RESOLVETIME)) {
            result.setStateBit(BundleDescriptionImpl.ATTACH_FRAGMENTS, true);
            result.setStateBit(BundleDescriptionImpl.DYNAMIC_FRAGMENTS, false);
          } else if (fragmentAttachment.equals(Constants.FRAGMENT_ATTACHMENT_NEVER)) {
            result.setStateBit(BundleDescriptionImpl.ATTACH_FRAGMENTS, false);
            result.setStateBit(BundleDescriptionImpl.DYNAMIC_FRAGMENTS, false);
          }
        }
        result.setDirective(Constants.MANDATORY_DIRECTIVE, ManifestElement.getArrayFromList(bsnElement.getDirective(Constants.MANDATORY_DIRECTIVE)));
        result.setAttributes(getAttributes(bsnElement, DEFINED_BSN_MATCHING_ATTRS));
      }
    }
    // retrieve other headers
    String version = manifest.get(Constants.BUNDLE_VERSION);
View Full Code Here

    registeredBuddyList = manifest.get(Constants.REGISTERED_POLICY);
    if (hasPackageInfo(bundledata.getEntry(Constants.OSGI_BUNDLE_MANIFEST)))
      flags |= FLAG_HAS_PACKAGE_INFO;
    String genFrom = manifest.get(PluginConverterImpl.GENERATED_FROM);
    if (genFrom != null) {
      ManifestElement generatedFrom = ManifestElement.parseHeader(PluginConverterImpl.GENERATED_FROM, genFrom)[0];
      if (generatedFrom != null) {
        manifestTimeStamp = Long.parseLong(generatedFrom.getValue());
        manifestType = Byte.parseByte(generatedFrom.getAttribute(PluginConverterImpl.MANIFEST_TYPE_ATTRIBUTE));
      }
    }
    if (isAutoStartable()) {
      bundledata.setStatus(bundledata.getStatus() | Constants.BUNDLE_LAZY_START);
      if (COMPATIBILITY_LAZYSTART)
View Full Code Here

    }

    //Now we know the symbolicId and the version of the bundle, we check to see if don't have a manifest for it already
    Version version = Version.parseVersion(generatedManifest.get(Constants.BUNDLE_VERSION));
    String symbolicName = ManifestElement.parseHeader(org.osgi.framework.Constants.BUNDLE_SYMBOLICNAME, generatedManifest.get(org.osgi.framework.Constants.BUNDLE_SYMBOLICNAME))[0].getValue();
    ManifestElement generatedFrom = ManifestElement.parseHeader(PluginConverterImpl.GENERATED_FROM, generatedManifest.get(PluginConverterImpl.GENERATED_FROM))[0];
    Headers<String, String> existingHeaders = checkManifestAndParent(cacheLocation, symbolicName, version.toString(), Byte.parseByte(generatedFrom.getAttribute(PluginConverterImpl.MANIFEST_TYPE_ATTRIBUTE)));
    //We don't have a manifest.
    manifestTimeStamp = Long.parseLong(generatedFrom.getValue());
    manifestType = Byte.parseByte(generatedFrom.getAttribute(PluginConverterImpl.MANIFEST_TYPE_ATTRIBUTE));
    if (bundledata.getAdaptor().isReadOnly() || existingHeaders != null)
      return existingHeaders;

    //merge the original manifest with the generated one
    if (builtIn != null) {
View Full Code Here

    String tag = GENERATED_FROM + ": "; //$NON-NLS-1$
    if (secondLine == null || !secondLine.startsWith(tag))
      return false;

    secondLine = secondLine.substring(tag.length());
    ManifestElement generatedFrom;
    try {
      generatedFrom = ManifestElement.parseHeader(PluginConverterImpl.GENERATED_FROM, secondLine)[0];
    } catch (BundleException be) {
      return false;
    }
    String timestampStr = generatedFrom.getValue();
    try {
      return Long.parseLong(timestampStr.trim()) == getTimeStamp(pluginLocation, manifestType);
    } catch (NumberFormatException nfe) {
      // not a big deal - just a bogus existing manifest that will be ignored
    }
View Full Code Here

    registeredBuddyList = (String) manifest.get(Constants.REGISTERED_POLICY);
    if (hasPackageInfo(bundledata.getEntry(Constants.OSGI_BUNDLE_MANIFEST)))
      flags |= FLAG_HAS_PACKAGE_INFO;
    String genFrom = (String) manifest.get(PluginConverterImpl.GENERATED_FROM);
    if (genFrom != null) {
      ManifestElement generatedFrom = ManifestElement.parseHeader(PluginConverterImpl.GENERATED_FROM, genFrom)[0];
      if (generatedFrom != null) {
        manifestTimeStamp = Long.parseLong(generatedFrom.getValue());
        manifestType = Byte.parseByte(generatedFrom.getAttribute(PluginConverterImpl.MANIFEST_TYPE_ATTRIBUTE));
      }
    }
    if (isAutoStartable()) {
      bundledata.setStatus(bundledata.getStatus() | Constants.BUNDLE_LAZY_START);
      if (COMPATIBILITY_LAZYSTART)
View Full Code Here

    }

    //Now we know the symbolicId and the version of the bundle, we check to see if don't have a manifest for it already
    Version version = Version.parseVersion((String) generatedManifest.get(Constants.BUNDLE_VERSION));
    String symbolicName = ManifestElement.parseHeader(org.osgi.framework.Constants.BUNDLE_SYMBOLICNAME, (String) generatedManifest.get(org.osgi.framework.Constants.BUNDLE_SYMBOLICNAME))[0].getValue();
    ManifestElement generatedFrom = ManifestElement.parseHeader(PluginConverterImpl.GENERATED_FROM, (String) generatedManifest.get(PluginConverterImpl.GENERATED_FROM))[0];
    Headers existingHeaders = checkManifestAndParent(cacheLocation, symbolicName, version.toString(), Byte.parseByte(generatedFrom.getAttribute(PluginConverterImpl.MANIFEST_TYPE_ATTRIBUTE)));
    //We don't have a manifest.
    manifestTimeStamp = Long.parseLong(generatedFrom.getValue());
    manifestType = Byte.parseByte(generatedFrom.getAttribute(PluginConverterImpl.MANIFEST_TYPE_ATTRIBUTE));
    if (bundledata.getAdaptor().isReadOnly() || existingHeaders != null)
      return existingHeaders;

    //merge the original manifest with the generated one
    if (builtIn != null) {
View Full Code Here

TOP

Related Classes of org.eclipse.osgi.util.ManifestElement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.