|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.virtual.plugins.context.AbstractVirtualFileHandler
org.jboss.virtual.plugins.context.AbstractURLHandler
org.jboss.virtual.plugins.context.jar.AbstractJarHandler
org.jboss.virtual.plugins.context.jar.AbstractStructuredJarHandler<byte[]>
org.jboss.virtual.plugins.context.jar.NestedJarFromStream
public class NestedJarFromStream
A nested jar implementation used to represent a jar within a jar.
Field Summary |
---|
Fields inherited from class org.jboss.virtual.plugins.context.AbstractVirtualFileHandler |
---|
cachedLastModified, log |
Constructor Summary | |
---|---|
NestedJarFromStream(VFSContext context,
VirtualFileHandler parent,
ZipInputStream zis,
URL jarURL,
JarFile jar,
ZipEntry entry,
String entryName)
Create a nested jar from the parent zip inputstream/zip entry. |
Method Summary | |
---|---|
void |
close()
Close the resources |
VirtualFileHandler |
createChildHandler(String name)
Create a virtual file context |
protected VirtualFileHandler |
createVirtualFileHandler(VirtualFileHandler parent,
org.jboss.virtual.plugins.context.jar.ZipEntryWrapper<byte[]> wrapper,
String entryName)
Create a new virtual file handler |
boolean |
delete(int gracePeriod)
Delete the file represented by this handler. |
boolean |
exists()
TODO: removing the entry/jar that resulted in this needs to be detected. |
protected void |
extraWrapperInfo(org.jboss.virtual.plugins.context.jar.ZipEntryWrapper<byte[]> wrapper)
Handle additional information about wrapper. |
VirtualFileHandler |
getChild(String path)
Get a child |
List<VirtualFileHandler> |
getChildren(boolean ignoreErrors)
Get the children |
long |
getLastModified()
When the file was last modified |
long |
getSize()
Get the size |
protected void |
init()
Initialize entries. |
protected void |
initCacheLastModified()
|
protected void |
initJarFile()
Initialize the jar file |
boolean |
isHidden()
Whether it is hidden |
boolean |
isNested()
Are we nested in some archive. |
InputStream |
openStream()
Access the file contents. |
boolean |
removeChild(String name)
Remove a child |
String |
toString()
|
URI |
toURI()
Get the VF URI (file://root/org/jboss/X.java) |
Methods inherited from class org.jboss.virtual.plugins.context.jar.AbstractStructuredJarHandler |
---|
buildParents, createSynthenticParent, initJarFile, internalReplaceChild, isArchive |
Methods inherited from class org.jboss.virtual.plugins.context.jar.AbstractJarHandler |
---|
fromURL, getEntry, getJar, getURL, handleJarFile, isLeaf |
Methods inherited from class org.jboss.virtual.plugins.context.AbstractURLHandler |
---|
getURL, openConnection, openConnection, toURL |
Methods inherited from class org.jboss.virtual.plugins.context.AbstractVirtualFileHandler |
---|
checkClosed, checkParentExists, cleanup, decrement, doClose, equals, getChildPathName, getChildVfsUrl, getLocalPathName, getLocalVFSContext, getName, getParent, getPathName, getRealURL, getReferences, getVFSContext, getVfsUrl, getVirtualFile, hasBeenModified, hashCode, increment, isTemporary, replaceChild, setPathName, setVfsUrl, simpleFindChild, structuredFindChild, toInternalVfsUrl, toStringLocal, toVfsUrl |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public NestedJarFromStream(VFSContext context, VirtualFileHandler parent, ZipInputStream zis, URL jarURL, JarFile jar, ZipEntry entry, String entryName) throws IOException
context
- - the context containing the jarparent
- - the jar handler for this nested jarzis
- - the jar zip input streamjarURL
- - the URL to use as the jar URLjar
- - the parent jar file for the nested jarentry
- - the zip entryentryName
- - the entry name
IOException
- for any errorMethod Detail |
---|
protected void initCacheLastModified()
initCacheLastModified
in class AbstractURLHandler
protected void init() throws IOException
IOException
- for any errorpublic List<VirtualFileHandler> getChildren(boolean ignoreErrors) throws IOException
VirtualFileHandler
getChildren
in interface VirtualFileHandler
getChildren
in class AbstractStructuredJarHandler<byte[]>
ignoreErrors
- whether to ignore errors
IOException
- for an error accessing the file systempublic VirtualFileHandler getChild(String path) throws IOException
VirtualFileHandler
getChild
in interface VirtualFileHandler
getChild
in class AbstractStructuredJarHandler<byte[]>
path
- the path
null
if not found
IOException
- for an error accessing the file systempublic boolean removeChild(String name) throws IOException
VirtualFileHandler
name
- child name
IOException
- if an error occurspublic VirtualFileHandler createChildHandler(String name) throws IOException
StructuredVirtualFileHandler
createChildHandler
in interface StructuredVirtualFileHandler
createChildHandler
in class AbstractStructuredJarHandler<byte[]>
name
- the name
IOException
- for any error accessing the virtual file systemprotected void extraWrapperInfo(org.jboss.virtual.plugins.context.jar.ZipEntryWrapper<byte[]> wrapper) throws IOException
AbstractStructuredJarHandler
extraWrapperInfo
in class AbstractStructuredJarHandler<byte[]>
wrapper
- the zip entry wrapper
IOException
- for any errorprotected VirtualFileHandler createVirtualFileHandler(VirtualFileHandler parent, org.jboss.virtual.plugins.context.jar.ZipEntryWrapper<byte[]> wrapper, String entryName) throws IOException
AbstractStructuredJarHandler
createVirtualFileHandler
in class AbstractStructuredJarHandler<byte[]>
parent
- the parentwrapper
- the entry wrapperentryName
- - the entry name without any trailing '/'
IOException
- for any error accessing the file systempublic boolean exists() throws IOException
exists
in interface VirtualFileHandler
exists
in class AbstractURLHandler
IOException
- - thrown on failure to detect existence.URLConnection.getLastModified()
,
org.jboss.test.virtual.test.URLExistsUnitTestCase
public boolean isHidden()
VirtualFileHandler
isHidden
in interface VirtualFileHandler
isHidden
in class AbstractURLHandler
public long getSize()
VirtualFileHandler
getSize
in interface VirtualFileHandler
getSize
in class AbstractURLHandler
public long getLastModified() throws IOException
VirtualFileHandler
getLastModified
in interface VirtualFileHandler
getLastModified
in class AbstractURLHandler
IOException
- for any problem accessing the virtual file systempublic boolean isNested() throws IOException
VirtualFileHandler
IOException
- for any errorpublic boolean delete(int gracePeriod)
AbstractVirtualFileHandler
VirtualFileHandler.removeChild(String)
of the parent
delete
in interface VirtualFileHandler
delete
in class AbstractVirtualFileHandler
gracePeriod
- max time to wait for any locks
public InputStream openStream() throws IOException
VirtualFileHandler
openStream
in interface VirtualFileHandler
openStream
in class AbstractURLHandler
IOException
- for any problem accessing the virtual file systempublic void close()
VirtualFileHandler
close
in interface VirtualFileHandler
close
in class AbstractVirtualFileHandler
public URI toURI() throws URISyntaxException
VirtualFileHandler
toURI
in interface VirtualFileHandler
toURI
in class AbstractURLHandler
URISyntaxException
- for an error parsing the URIpublic String toString()
toString
in class AbstractVirtualFileHandler
protected void initJarFile() throws IOException
AbstractStructuredJarHandler
initJarFile
in class AbstractStructuredJarHandler<byte[]>
IOException
- for any error reading the jar file
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |