public class DirectoryBundleFile extends Object implements BundleFile
BundleFile
that is backed by a filesystem directory, for use in
test settings from Eclipse or maven.Modifier and Type | Field and Description |
---|---|
static String |
MANIFEST_PATH |
Constructor and Description |
---|
DirectoryBundleFile(File file) |
DirectoryBundleFile(File file,
Manifest mf) |
Modifier and Type | Method and Description |
---|---|
void |
close(OSGiAdapter osgi)
Close underlying file resources
*
|
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.
|
static void |
main(String[] args) |
String |
toString() |
public static final String MANIFEST_PATH
public DirectoryBundleFile(File file) throws IOException
IOException
public DirectoryBundleFile(File file, Manifest mf) throws IOException
IOException
public Enumeration<URL> findEntries(String name, String pattern, boolean recurse)
BundleFile
findEntries
in interface BundleFile
Bundle.findEntries(String, String, boolean)
public URL getEntry(String name)
BundleFile
getEntry
in interface BundleFile
Bundle.getEntry(String)
public Enumeration<String> getEntryPaths(String path)
BundleFile
String
objects)
to entries within the bundle whose longest sub-path matches the supplied
path argument.getEntryPaths
in interface BundleFile
Bundle.getEntryPaths(String)
public File getFile()
BundleFile
getFile
in interface BundleFile
public String getFileName()
BundleFile
getFileName
in interface BundleFile
public String getLocation()
BundleFile
This is an URI string pointing to the original locatioon of the bundle.
getLocation
in interface BundleFile
public Manifest getManifest()
BundleFile
getManifest
in interface BundleFile
public Collection<BundleFile> getNestedBundles(File tmpDir) throws IOException
BundleFile
getNestedBundles
in interface BundleFile
tmpDir
- optional temporary dir if the nested bundle should be
extracted from an archiveIOException
public Collection<BundleFile> findNestedBundles(File tmpDir) throws IOException
BundleFile
findNestedBundles
in interface BundleFile
tmpDir
- optional temporary dir if the nested bundle should be
extracted from an archiveIOException
public String getSymbolicName()
BundleFile
getSymbolicName
in interface BundleFile
public URL getURL()
BundleFile
getURL
in interface BundleFile
public boolean isDirectory()
BundleFile
isDirectory
in interface BundleFile
public boolean isJar()
BundleFile
isJar
in interface BundleFile
public void close(OSGiAdapter osgi) throws IOException
BundleFile
close
in interface BundleFile
IOException
Copyright © 2013 Nuxeo SA. All Rights Reserved.