Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.osgi
Interface BundleFile

All Known Implementing Classes:
DirectoryBundleFile, JarBundleFile, JBossBundleFile, NestedJarBundleFile, SystemBundleFile

public interface BundleFile

Author:
Bogdan Stefanescu

Method Summary
 Enumeration<URL> findEntries(String name, String pattern, boolean recurse)
          Finds entries in that bundle.
 Collection<BundleFile> findNestedBundles(File tmpDir)
          Get a list with nested bundles or null if none.
 URL getEntry(String name)
          Gets the entry at the given path in this bundle.
 Enumeration<String> getEntryPaths(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.
 File getFile()
          Gets the current location of the bundle as a file.
 String getFileName()
          Gets the original file name of this bundle.
 String getLocation()
          Gets the original location of this bundle.
 Manifest getManifest()
          Gets the bundle manifest.
 Collection<BundleFile> getNestedBundles(File tmpDir)
          Gets a list with nested bundles or null if none.
 String getSymbolicName()
          Gets this bundle symbolic name.
 URL getURL()
          Gets the current location of the bundle as an URL (it may be different from the original location).
 boolean isDirectory()
          Checks if this bundle is a directory (an exploded jar).
 boolean isJar()
          Checks if this bundle is a JAR.
 

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

getManifest

Manifest getManifest()
Gets the bundle manifest.

Returns:
the bundle manifest

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<String> getEntryPaths(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)

findEntries

Enumeration<URL> findEntries(String name,
                             String pattern,
                             boolean recurse)
Finds entries in that bundle.

See Also:
Bundle.findEntries(String, String, boolean)

getNestedBundles

Collection<BundleFile> getNestedBundles(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<BundleFile> findNestedBundles(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

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.