org.glassfish.osgijavaeebase
Class OSGiBundleArchive
java.lang.Object
com.sun.enterprise.deploy.shared.AbstractReadableArchive
org.glassfish.osgijavaeebase.OSGiBundleArchive
- All Implemented Interfaces:
- Iterable<BundleResource>, org.glassfish.api.deployment.archive.Archive, org.glassfish.api.deployment.archive.ReadableArchive, URIable
public class OSGiBundleArchive
- extends com.sun.enterprise.deploy.shared.AbstractReadableArchive
- implements URIable, Iterable<BundleResource>
Adapts a Bundle to Archive.
It uses JAR File space of the bundle (via getEntry and getEntryPaths APIs),
so a bundle does not have to be in resolved state.
Since it represents JAR File space of the bundle, it does not
consider resources from any fragments.
- Author:
- Sanjeeb.Sahoo@Sun.COM
| Fields inherited from class com.sun.enterprise.deploy.shared.AbstractReadableArchive |
extraData, parentArchive |
| Methods inherited from class com.sun.enterprise.deploy.shared.AbstractReadableArchive |
getExtraData, removeExtraData, setExtraData |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OSGiBundleArchive
public OSGiBundleArchive(org.osgi.framework.Bundle b)
close
public void close()
throws IOException
- Specified by:
close in interface org.glassfish.api.deployment.archive.Archive
- Throws:
IOException
entries
public Enumeration<String> entries()
- Specified by:
entries in interface org.glassfish.api.deployment.archive.Archive
getDirectories
public Collection<String> getDirectories()
throws IOException
- Returns the enumeration of first level directories in this
archive
- Specified by:
getDirectories in interface org.glassfish.api.deployment.archive.Archive
- Returns:
- enumeration of directories under the root of this archive
- Throws:
IOException
entries
public Enumeration<String> entries(String prefix)
- Specified by:
entries in interface org.glassfish.api.deployment.archive.Archive
isDirectory
public boolean isDirectory(String name)
- Specified by:
isDirectory in interface org.glassfish.api.deployment.archive.Archive
getManifest
public Manifest getManifest()
throws IOException
- Specified by:
getManifest in interface org.glassfish.api.deployment.archive.Archive
- Throws:
IOException
getURI
public URI getURI()
- It returns URI for the underlying file if it can locate such a file.
Else, it returns null.
- Specified by:
getURI in interface org.glassfish.api.deployment.archive.Archive
- Returns:
getArchiveSize
public long getArchiveSize()
throws SecurityException
- Specified by:
getArchiveSize in interface org.glassfish.api.deployment.archive.Archive
- Throws:
SecurityException
getName
public String getName()
- Specified by:
getName in interface org.glassfish.api.deployment.archive.Archive
getEntry
public InputStream getEntry(String name)
throws IOException
- Specified by:
getEntry in interface org.glassfish.api.deployment.archive.ReadableArchive
- Throws:
IOException
exists
public boolean exists(String name)
- Specified by:
exists in interface org.glassfish.api.deployment.archive.ReadableArchive
getEntrySize
public long getEntrySize(String name)
- Specified by:
getEntrySize in interface org.glassfish.api.deployment.archive.ReadableArchive
open
public void open(URI uri)
throws IOException
- Specified by:
open in interface org.glassfish.api.deployment.archive.ReadableArchive
- Throws:
IOException
getSubArchive
public org.glassfish.api.deployment.archive.ReadableArchive getSubArchive(String name)
throws IOException
- Specified by:
getSubArchive in interface org.glassfish.api.deployment.archive.ReadableArchive
- Throws:
IOException
exists
public boolean exists()
- Specified by:
exists in interface org.glassfish.api.deployment.archive.ReadableArchive
delete
public boolean delete()
- Specified by:
delete in interface org.glassfish.api.deployment.archive.ReadableArchive
renameTo
public boolean renameTo(String name)
- Specified by:
renameTo in interface org.glassfish.api.deployment.archive.ReadableArchive
setParentArchive
public void setParentArchive(org.glassfish.api.deployment.archive.ReadableArchive parentArchive)
- Specified by:
setParentArchive in interface org.glassfish.api.deployment.archive.ReadableArchive- Overrides:
setParentArchive in class com.sun.enterprise.deploy.shared.AbstractReadableArchive
getParentArchive
public org.glassfish.api.deployment.archive.ReadableArchive getParentArchive()
- Specified by:
getParentArchive in interface org.glassfish.api.deployment.archive.ReadableArchive- Overrides:
getParentArchive in class com.sun.enterprise.deploy.shared.AbstractReadableArchive
getEntryURI
public URI getEntryURI(String name)
- Specified by:
getEntryURI in interface URIable
- Parameters:
name - the entry name relative to the root of the archive
- Returns:
- the URI corresponding to the entry, null if no such entry found
getDistanceFromTop
public String getDistanceFromTop()
- Description copied from interface:
URIable
- When this archive is embedded in another archive, this method returns the distance from top.
- Specified by:
getDistanceFromTop in interface URIable
- Returns:
iterator
public Iterator<BundleResource> iterator()
- Specified by:
iterator in interface Iterable<BundleResource>
getInputStream
public InputStream getInputStream()
throws IOException
- Returns:
- a Jar format InputStream for this bundle's content
- Throws:
IOException
Copyright © 2012 GlassFish Community. All Rights Reserved.