Interface BundleFile

    • Method Detail

      • isJar

        boolean isJar()
        Checks if this bundle is a JAR.
        Returns:
        true if the bundle is a JAR, false otherwise
      • isDirectory

        boolean isDirectory()
        Checks if this bundle is a directory (an exploded jar).
        Returns:
        true if the bundle is a directory, false otherwise
      • getSymbolicName

        String getSymbolicName()
        Gets this bundle symbolic name. If this bundle is an OSGi bundle, then the Bundle-SymbolicName manifest header is returned, otherwise null is returned.
        Returns:
        null if not an OSGi bundle, the OSGI bundle symbolic name otherwise
      • getFileName

        String getFileName()
        Gets the original file name of this bundle.
        Returns:
        the bundle file name
      • getLocation

        String getLocation()
        Gets the original location of this bundle.

        This is an URI string pointing to the original locatioon of the bundle.

        Returns:
        the location
      • getURL

        URL getURL()
        Gets the current location of the bundle as an URL (it may be different from the original location).
        Returns:
        the bundle url
      • getFile

        File getFile()
        Gets the current location of the bundle as a file.
        Returns:
        the bundle file or null if the bundle is not a file
      • getEntry

        URL getEntry​(String name)
        Gets the entry at the given path in this bundle.
        Returns:
        the entry URL if any null otherwise
        See Also:
        Bundle.getEntry(String)
      • getEntryPaths

        Enumeration<StringgetEntryPaths​(String path)
        Returns an Enumeration of all the paths (String objects) to entries within the bundle whose longest sub-path matches the supplied path argument.
        See Also:
        Bundle.getEntryPaths(String)
      • getNestedBundles

        Collection<BundleFilegetNestedBundles​(File tmpDir)
                                         throws IOException
        Gets a list with nested bundles or null if none. The bundle Manifest headers Bundle-ClassPath and Class-Path will be used to retrieve nested jars.
        Parameters:
        tmpDir - optional temporary dir if the nested bundle should be extracted from an archive
        Throws:
        IOException
      • findNestedBundles

        Collection<BundleFilefindNestedBundles​(File tmpDir)
                                          throws IOException
        Get a list with nested bundles or null if none. The bundle file will be scanned for nested JARs.
        Parameters:
        tmpDir - optional temporary dir if the nested bundle should be extracted from an archive
        Throws:
        IOException