Package org.nuxeo.osgi
Class DirectoryBundleFile
- java.lang.Object
- 
- org.nuxeo.osgi.DirectoryBundleFile
 
- 
- All Implemented Interfaces:
- BundleFile
 - Direct Known Subclasses:
- SystemBundleFile
 
 public class DirectoryBundleFile extends Object implements BundleFile ABundleFilethat is backed by a filesystem directory, for use in test settings from Eclipse or maven.
- 
- 
Constructor SummaryConstructors Constructor Description DirectoryBundleFile(File file)DirectoryBundleFile(File file, Manifest mf)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close underlying file resources *Enumeration<URL>findEntries(String name, String pattern, boolean recurse)Finds entries in that bundle.protected List<File>findFiles(File file)protected ManifestfindManifest()Collection<BundleFile>findNestedBundles(File tmpDir)Get a list with nested bundles or null if none.URLgetEntry(String name)Gets the entry at the given path in this bundle.Enumeration<String>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.FilegetFile()Gets the current location of the bundle as a file.StringgetFileName()Gets the original file name of this bundle.StringgetLocation()Gets the original location of this bundle.ManifestgetManifest()Gets the bundle manifest.Collection<BundleFile>getNestedBundles(File tmpDir)Gets a list with nested bundles or null if none.StringgetSymbolicName()Gets this bundle symbolic name.URLgetURL()Gets the current location of the bundle as an URL (it may be different from the original location).booleanisDirectory()Checks if this bundle is a directory (an exploded jar).booleanisJar()Checks if this bundle is a JAR.static voidmain(String[] args)StringtoString()
 
- 
- 
- 
Constructor Detail- 
DirectoryBundleFilepublic DirectoryBundleFile(File file) throws IOException - Throws:
- IOException
 
 - 
DirectoryBundleFilepublic DirectoryBundleFile(File file, Manifest mf) throws IOException - Throws:
- IOException
 
 
- 
 - 
Method Detail- 
findEntriespublic Enumeration<URL> findEntries(String name, String pattern, boolean recurse) Description copied from interface:BundleFileFinds entries in that bundle.- Specified by:
- findEntriesin interface- BundleFile
- See Also:
- Bundle.findEntries(String, String, boolean)
 
 - 
getEntrypublic URL getEntry(String name) Description copied from interface:BundleFileGets the entry at the given path in this bundle.- Specified by:
- getEntryin interface- BundleFile
- Returns:
- the entry URL if any null otherwise
- See Also:
- Bundle.getEntry(String)
 
 - 
getEntryPathspublic Enumeration<String> getEntryPaths(String path) 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 interface- BundleFile
- See Also:
- Bundle.getEntryPaths(String)
 
 - 
getFilepublic File getFile() Description copied from interface:BundleFileGets the current location of the bundle as a file.- Specified by:
- getFilein interface- BundleFile
- Returns:
- the bundle file or null if the bundle is not a file
 
 - 
getFileNamepublic String getFileName() Description copied from interface:BundleFileGets the original file name of this bundle.- Specified by:
- getFileNamein interface- BundleFile
- Returns:
- the bundle file name
 
 - 
getLocationpublic String 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 interface- BundleFile
- Returns:
- the location
 
 - 
getManifestpublic Manifest getManifest() Description copied from interface:BundleFileGets the bundle manifest.- Specified by:
- getManifestin interface- BundleFile
- Returns:
- the bundle manifest
 
 - 
findManifestprotected Manifest findManifest() throws IOException - Throws:
- IOException
 
 - 
getNestedBundlespublic Collection<BundleFile> getNestedBundles(File tmpDir) throws IOException 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 interface- BundleFile
- Parameters:
- tmpDir- optional temporary dir if the nested bundle should be extracted from an archive
- Throws:
- IOException
 
 - 
findNestedBundlespublic Collection<BundleFile> findNestedBundles(File tmpDir) throws IOException 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 interface- BundleFile
- Parameters:
- tmpDir- optional temporary dir if the nested bundle should be extracted from an archive
- Throws:
- IOException
 
 - 
getSymbolicNamepublic String 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 interface- BundleFile
- Returns:
- null if not an OSGi bundle, the OSGI bundle symbolic name otherwise
 
 - 
getURLpublic URL 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 interface- BundleFile
- Returns:
- the bundle url
 
 - 
isDirectorypublic boolean isDirectory() Description copied from interface:BundleFileChecks if this bundle is a directory (an exploded jar).- Specified by:
- isDirectoryin interface- BundleFile
- Returns:
- true if the bundle is a directory, false otherwise
 
 - 
isJarpublic boolean isJar() Description copied from interface:BundleFileChecks if this bundle is a JAR.- Specified by:
- isJarin interface- BundleFile
- Returns:
- true if the bundle is a JAR, false otherwise
 
 - 
closepublic void close() Description copied from interface:BundleFileClose underlying file resources *- Specified by:
- closein interface- BundleFile
 
 
- 
 
-