Package org.nuxeo.osgi
Class DirectoryBundleFile
java.lang.Object
org.nuxeo.osgi.DirectoryBundleFile
- All Implemented Interfaces:
BundleFile
- Direct Known Subclasses:
SystemBundleFile
A
BundleFile that is backed by a filesystem directory, for use in test settings from Eclipse or maven.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close underlying file resources *findEntries(String name, String pattern, boolean recurse) Finds entries in that bundle.protected ManifestfindNestedBundles(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 (Stringobjects) 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).booleanChecks if this bundle is a directory (an exploded jar).booleanisJar()Checks if this bundle is a JAR.static voidtoString()
-
Field Details
-
MANIFEST_PATH
- See Also:
-
file
-
files
-
mf
-
-
Constructor Details
-
DirectoryBundleFile
- Throws:
IOException
-
DirectoryBundleFile
- Throws:
IOException
-
-
Method Details
-
findFiles
-
findEntries
Description copied from interface:BundleFileFinds entries in that bundle.- Specified by:
findEntriesin interfaceBundleFile- See Also:
-
getEntry
Description copied from interface:BundleFileGets the entry at the given path in this bundle.- Specified by:
getEntryin interfaceBundleFile- Returns:
- the entry URL if any null otherwise
- See Also:
-
getEntryPaths
Description copied from interface:BundleFileReturns an Enumeration of all the paths (Stringobjects) to entries within the bundle whose longest sub-path matches the supplied path argument.- Specified by:
getEntryPathsin interfaceBundleFile- See Also:
-
getFile
Description copied from interface:BundleFileGets the current location of the bundle as a file.- Specified by:
getFilein interfaceBundleFile- Returns:
- the bundle file or null if the bundle is not a file
-
getFileName
Description copied from interface:BundleFileGets the original file name of this bundle.- Specified by:
getFileNamein interfaceBundleFile- Returns:
- the bundle file name
-
getLocation
Description copied from interface:BundleFileGets the original location of this bundle.This is an URI string pointing to the original locatioon of the bundle.
- Specified by:
getLocationin interfaceBundleFile- Returns:
- the location
-
getManifest
Description copied from interface:BundleFileGets the bundle manifest.- Specified by:
getManifestin interfaceBundleFile- Returns:
- the bundle manifest
-
findManifest
- Throws:
IOException
-
getNestedBundles
Description copied from interface:BundleFileGets 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.- Specified by:
getNestedBundlesin interfaceBundleFile- Parameters:
tmpDir- optional temporary dir if the nested bundle should be extracted from an archive- Throws:
IOException
-
findNestedBundles
Description copied from interface:BundleFileGet a list with nested bundles or null if none. The bundle file will be scanned for nested JARs.- Specified by:
findNestedBundlesin interfaceBundleFile- Parameters:
tmpDir- optional temporary dir if the nested bundle should be extracted from an archive- Throws:
IOException
-
getSymbolicName
Description copied from interface:BundleFileGets this bundle symbolic name. If this bundle is an OSGi bundle, then the Bundle-SymbolicName manifest header is returned, otherwise null is returned.- Specified by:
getSymbolicNamein interfaceBundleFile- Returns:
- null if not an OSGi bundle, the OSGI bundle symbolic name otherwise
-
getURL
Description copied from interface:BundleFileGets the current location of the bundle as an URL (it may be different from the original location).- Specified by:
getURLin interfaceBundleFile- Returns:
- the bundle url
-
isDirectory
public boolean isDirectory()Description copied from interface:BundleFileChecks if this bundle is a directory (an exploded jar).- Specified by:
isDirectoryin interfaceBundleFile- Returns:
- true if the bundle is a directory, false otherwise
-
isJar
public boolean isJar()Description copied from interface:BundleFileChecks if this bundle is a JAR.- Specified by:
isJarin interfaceBundleFile- Returns:
- true if the bundle is a JAR, false otherwise
-
toString
-
main
- Throws:
Exception
-
close
public void close()Description copied from interface:BundleFileClose underlying file resources *- Specified by:
closein interfaceBundleFile
-