Package org.nuxeo.osgi
Interface BundleFile
- All Known Implementing Classes:
DirectoryBundleFile
,JarBundleFile
,NestedJarBundleFile
,SystemBundleFile
public interface BundleFile
- Author:
- Bogdan Stefanescu
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close underlying file resources *findEntries
(String name, String pattern, boolean recurse) Finds entries in that bundle.findNestedBundles
(File tmpDir) Get a list with nested bundles or null if none.Gets the entry at the given path in this bundle.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.getFile()
Gets the current location of the bundle as a file.Gets the original file name of this bundle.Gets the original location of this bundle.Gets the bundle manifest.getNestedBundles
(File tmpDir) Gets a list with nested bundles or null if none.Gets this bundle symbolic name.getURL()
Gets the current location of the bundle as an URL (it may be different from the original location).boolean
Checks if this bundle is a directory (an exploded jar).boolean
isJar()
Checks if this bundle is a JAR.
-
Method Details
-
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
Gets the entry at the given path in this bundle.- Returns:
- the entry URL if any null otherwise
- See Also:
-
Bundle.getEntry(String)
-
getEntryPaths
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
Finds entries in that bundle.- See Also:
-
Bundle.findEntries(String, String, boolean)
-
getNestedBundles
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
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
-
close
Close underlying file resources *- Throws:
IOException
- Since:
- 5.6
-