public class JarBundleFile extends Object implements BundleFile
| Modifier and Type | Field and Description |
|---|---|
protected JarFile |
jarFile |
protected String |
urlBase |
| Constructor and Description |
|---|
JarBundleFile(File file) |
JarBundleFile(JarFile jarFile) |
| Modifier and Type | Method and Description |
|---|---|
void |
close(OSGiAdapter osgi)
Close underlying file resources *
|
static void |
extractNestedJar(JarFile file,
String path,
File dest) |
static void |
extractNestedJar(JarFile file,
ZipEntry entry,
File dest) |
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. |
protected URL |
getEntryUrl(String name) |
File |
getFile()
Gets the current location of the bundle as a file.
|
String |
getFileName()
Gets the original file name of this bundle.
|
URL |
getJarURL() |
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.
|
String |
toString() |
public JarBundleFile(File file) throws IOException
IOExceptionpublic JarBundleFile(JarFile jarFile)
public Enumeration<URL> findEntries(String name, String pattern, boolean recurse)
BundleFilefindEntries in interface BundleFileBundle.findEntries(String, String, boolean)public URL getEntry(String name)
BundleFilegetEntry in interface BundleFileBundle.getEntry(String)public Enumeration<String> getEntryPaths(String path)
BundleFileString objects) to entries within the bundle whose longest
sub-path matches the supplied path argument.getEntryPaths in interface BundleFileBundle.getEntryPaths(String)public File getFile()
BundleFilegetFile in interface BundleFilepublic String getFileName()
BundleFilegetFileName in interface BundleFilepublic String getLocation()
BundleFileThis is an URI string pointing to the original locatioon of the bundle.
getLocation in interface BundleFilepublic Manifest getManifest()
BundleFilegetManifest in interface BundleFilepublic Collection<BundleFile> getNestedBundles(File tmpDir) throws IOException
BundleFilegetNestedBundles in interface BundleFiletmpDir - optional temporary dir if the nested bundle should be extracted from an archiveIOExceptionpublic static void extractNestedJar(JarFile file, String path, File dest) throws IOException
IOExceptionpublic static void extractNestedJar(JarFile file, ZipEntry entry, File dest) throws IOException
IOExceptionpublic Collection<BundleFile> findNestedBundles(File tmpDir) throws IOException
BundleFilefindNestedBundles in interface BundleFiletmpDir - optional temporary dir if the nested bundle should be extracted from an archiveIOExceptionpublic String getSymbolicName()
BundleFilegetSymbolicName in interface BundleFilepublic URL getURL()
BundleFilegetURL in interface BundleFilepublic boolean isDirectory()
BundleFileisDirectory in interface BundleFilepublic boolean isJar()
BundleFileisJar in interface BundleFileprotected final URL getEntryUrl(String name) throws MalformedURLException
MalformedURLExceptionpublic void close(OSGiAdapter osgi) throws IOException
BundleFileclose in interface BundleFileIOExceptionCopyright © 2015 Nuxeo SA. All rights reserved.