Java Jar Manifest isOSGiManifest(Manifest manifest)

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

Description

is OS Gi Manifest

License

Open Source License

Declaration

public static boolean isOSGiManifest(Manifest manifest) 

Method Source Code

//package com.java2s;
/**/*  w ww  .j  a v a 2 s  . c  om*/
 * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

import java.util.jar.Attributes;
import java.util.jar.Manifest;

public class Main {
    public static boolean isOSGiManifest(Manifest manifest) {
        Attributes mainAttributes = manifest.getMainAttributes();

        return mainAttributes.containsKey(new Attributes.Name("Bundle-Name"));
    }
}

Related

  1. getManifestProperty(Manifest manifest, String propertyName)
  2. getManifestValue(File jarFile, String key)
  3. getManifestValue(JarFile jarFile, String key, String defaultValue)
  4. getManifestVersionNumber(File file)
  5. getValueFromAttr(Attributes attributes, String manifestValue)
  6. manifestToProperties(Attributes d)
  7. merge(Manifest into, Manifest from)
  8. stripManifest(Manifest manifestIn)