org.jboss.osgi.spi.util
Class BundleInfo

java.lang.Object
  extended by org.jboss.osgi.spi.util.BundleInfo
All Implemented Interfaces:
java.io.Serializable

public class BundleInfo
extends java.lang.Object
implements java.io.Serializable

Primitive access to bundle meta data and root virtual file. The bundle info can be constructed from various locations. If that succeeds, there is a valid OSGi Manifest.

Since:
16-Oct-2009
Author:
thomas.diesler@jboss.com
See Also:
Serialized Form

Method Summary
static BundleInfo createBundleInfo(java.lang.String location)
           
static BundleInfo createBundleInfo(java.net.URL url)
           
static BundleInfo createBundleInfo(org.jboss.virtual.VirtualFile root)
           
static BundleInfo createBundleInfo(org.jboss.virtual.VirtualFile root, java.lang.String location)
           
 boolean equals(java.lang.Object obj)
           
static int getBundleManifestVersion(java.util.jar.Manifest manifest)
          Get the bundle manifest version.
 java.lang.String getLocation()
          Get the bundle location
 java.lang.String getManifestHeader(java.lang.String key)
          Get the manifest header for the given key.
 org.jboss.virtual.VirtualFile getRoot()
          Get the bundle root file
 java.net.URL getRootURL()
          Get the bundle root url
 java.lang.String getSymbolicName()
          Get the bundle symbolic name
 org.osgi.framework.Version getVersion()
          Get the bundle version
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

createBundleInfo

public static BundleInfo createBundleInfo(java.lang.String location)
                                   throws org.osgi.framework.BundleException
Throws:
org.osgi.framework.BundleException

createBundleInfo

public static BundleInfo createBundleInfo(java.net.URL url)
                                   throws org.osgi.framework.BundleException
Throws:
org.osgi.framework.BundleException

createBundleInfo

public static BundleInfo createBundleInfo(org.jboss.virtual.VirtualFile root)
                                   throws org.osgi.framework.BundleException
Throws:
org.osgi.framework.BundleException

createBundleInfo

public static BundleInfo createBundleInfo(org.jboss.virtual.VirtualFile root,
                                          java.lang.String location)
                                   throws org.osgi.framework.BundleException
Throws:
org.osgi.framework.BundleException

getBundleManifestVersion

public static int getBundleManifestVersion(java.util.jar.Manifest manifest)
Get the bundle manifest version.

Parameters:
manifest - The given manifest
Returns:
The value of the Bundle-ManifestVersion header, or -1 for a non OSGi manifest

getManifestHeader

public java.lang.String getManifestHeader(java.lang.String key)
Get the manifest header for the given key.


getLocation

public java.lang.String getLocation()
Get the bundle location


getRoot

public org.jboss.virtual.VirtualFile getRoot()
Get the bundle root file


getRootURL

public java.net.URL getRootURL()
Get the bundle root url


getSymbolicName

public java.lang.String getSymbolicName()
Get the bundle symbolic name


getVersion

public org.osgi.framework.Version getVersion()
Get the bundle version


equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2010. All Rights Reserved.