Class BundleInstaller.EmbeddedLocation

java.lang.Object
org.osgi.test.common.install.BundleInstaller.EmbeddedLocation
Enclosing class:
BundleInstaller

public static class BundleInstaller.EmbeddedLocation extends Object
EmbeddedLocation describes a Location of a File inside a Bundle.
  • Method Details

    • of

      public static BundleInstaller.EmbeddedLocation of(org.osgi.framework.BundleContext bundleContext, Optional<String> oBundleSymbolicName, Optional<String> oBundleVersion, Optional<String> oPath, String file)
      Creates an EmbeddedLocation by the given parameters. Existence of File is tested at creation time.
      Parameters:
      bundleContext - - if null it searches the file in the root of the BundelContexts bundle.
      oBundleSymbolicName - s- ymbolicName of the bundle that embedded the file must not be null
      oBundleVersion - - version of the bundle that embedded the file -
      oPath - - the optional path in the jar
      file - - the filename must not be null
      Returns:
      EmbeddedLocation
    • of

      public static BundleInstaller.EmbeddedLocation of(org.osgi.framework.BundleContext bundleContext, String spec) throws IllegalArgumentException
      Creates an EmbeddedLocation by the spec. Existence of File is tested at creation time.
      Parameters:
      bundleContext -
      spec - 'bundle.symbolic.name:1.2.3:/path/file.jar'

      In minimum 'file.jar' must be used. Then it searches the file in the root of the BundelContexts bundle.

      Returns:
      EmbeddedLocation
      Throws:
      IllegalArgumentException
    • of

      public static BundleInstaller.EmbeddedLocation of(String bundleSymbolicName, org.osgi.framework.Version bundleVersion, String path, String file)
      Creates an EmbeddedLocation by the pure parameters. existence of File not tested at creation time.
      Parameters:
      bundleSymbolicName - - symbolicName of the bundle that embedded the file must not be null
      bundleVersion - - version of the bundle that embedded the file - must not be null
      path - - the path in the jar - must not be null
      file - - the filename must not be null
      Returns:
      EmbeddedLocation
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • openStream

      public InputStream openStream(org.osgi.framework.BundleContext bc) throws IOException
      Throws:
      IOException
    • getURL

      public URL getURL(org.osgi.framework.BundleContext bc) throws IOException
      Throws:
      IOException
    • toString

      public String toString()
      Overrides:
      toString in class Object