|
||||||||||
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.zip.ZipEntryHandler
public class ZipEntryHandler
Handler representing an individual file (ZipEntry) within ZipEntryContext
Field Summary |
---|
Fields inherited from class org.jboss.virtual.plugins.context.AbstractVirtualFileHandler |
---|
cachedLastModified, log |
Constructor Summary | |
---|---|
ZipEntryHandler(ZipEntryContext context,
AbstractVirtualFileHandler parent,
java.lang.String name,
boolean isLeaf)
Create a new ZipEntryHandler. |
Method Summary | |
---|---|
void |
cleanup()
Cleanup resources. |
VirtualFileHandler |
createChildHandler(java.lang.String name)
Create a virtual file context |
boolean |
delete(int gracePeriod)
Delete the file represented by this handler. |
boolean |
exists()
Tests whether the underlying implementation file still exists. |
java.security.cert.Certificate[] |
getCertificates()
Get certificates. |
VirtualFileHandler |
getChild(java.lang.String path)
Get a child |
java.util.List<VirtualFileHandler> |
getChildren(boolean ignoreErrors)
Get the children |
long |
getLastModified()
When the file was last modified |
java.net.URL |
getRealURL()
Get a file: or jar:file: URL representing a resource as precisely as possible. |
long |
getSize()
Get the size |
protected void |
internalReplaceChild(VirtualFileHandler original,
VirtualFileHandler replacement)
Replace original child with unpacked replacement. |
boolean |
isArchive()
Does this represent an archive. |
boolean |
isHidden()
Whether it is hidden |
boolean |
isLeaf()
Whether it is a simple leaf of the VFS, i.e. |
boolean |
isNested()
Are we nested in some archive. |
java.io.InputStream |
openStream()
Access the file contents. |
boolean |
removeChild(java.lang.String name)
Remove a child |
protected java.net.URL |
toInternalVfsUrl()
Get internal representation of vfs url. |
java.net.URI |
toURI()
Get the VF URI (file://root/org/jboss/X.java) |
Methods inherited from class org.jboss.virtual.plugins.context.AbstractVirtualFileHandler |
---|
checkClosed, checkParentExists, close, decrement, doClose, equals, getChildPathName, getChildVfsUrl, getLocalPathName, getLocalVFSContext, getName, getParent, getPathName, getReferences, getVFSContext, getVfsUrl, getVirtualFile, hasBeenModified, hashCode, increment, isTemporary, replaceChild, setPathName, setVfsUrl, simpleFindChild, structuredFindChild, toString, toStringLocal, toURL, toVfsUrl |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ZipEntryHandler(ZipEntryContext context, AbstractVirtualFileHandler parent, java.lang.String name, boolean isLeaf) throws java.io.IOException
context
- ZipEntryContextparent
- parent within the same contextname
- name of this file within contextisLeaf
- true if this file should have a URL not ending with '/', false otherwise
java.io.IOException
- for any errorMethod Detail |
---|
public java.net.URI toURI() throws java.net.URISyntaxException
VirtualFileHandler
toURI
in interface VirtualFileHandler
java.net.URISyntaxException
- for an error parsing the URIpublic long getLastModified() throws java.io.IOException
VirtualFileHandler
getLastModified
in interface VirtualFileHandler
java.io.IOException
- for any problem accessing the virtual file systempublic long getSize() throws java.io.IOException
VirtualFileHandler
getSize
in interface VirtualFileHandler
java.io.IOException
- for any problem accessing the virtual file systempublic boolean exists() throws java.io.IOException
VirtualFileHandler
exists
in interface VirtualFileHandler
java.io.IOException
- - thrown on failure to detect existence.public boolean isLeaf() throws java.io.IOException
VirtualFileHandler
isLeaf
in interface VirtualFileHandler
java.io.IOException
- for any problem accessing the virtual file systempublic boolean isArchive() throws java.io.IOException
VirtualFileHandler
isArchive
in interface VirtualFileHandler
isArchive
in class AbstractVirtualFileHandler
java.io.IOException
- for any problem accessing the virtual file systempublic boolean isHidden() throws java.io.IOException
VirtualFileHandler
isHidden
in interface VirtualFileHandler
java.io.IOException
- for any problem accessing the virtual file systempublic boolean isNested() throws java.io.IOException
VirtualFileHandler
isNested
in interface VirtualFileHandler
java.io.IOException
- for any errorpublic java.io.InputStream openStream() throws java.io.IOException
VirtualFileHandler
openStream
in interface VirtualFileHandler
java.io.IOException
- for any problem accessing the virtual file systempublic java.util.List<VirtualFileHandler> getChildren(boolean ignoreErrors) throws java.io.IOException
VirtualFileHandler
getChildren
in interface VirtualFileHandler
ignoreErrors
- whether to ignore errors
java.io.IOException
- for an error accessing the file systempublic VirtualFileHandler getChild(java.lang.String path) throws java.io.IOException
VirtualFileHandler
getChild
in interface VirtualFileHandler
path
- the path
null
if not found
java.io.IOException
- for an error accessing the file systempublic boolean removeChild(java.lang.String name) throws java.io.IOException
VirtualFileHandler
removeChild
in interface VirtualFileHandler
name
- child name
java.io.IOException
- if an error occurspublic void cleanup()
VirtualFileHandler
cleanup
in interface VirtualFileHandler
cleanup
in class AbstractVirtualFileHandler
public boolean delete(int gracePeriod) throws java.io.IOException
AbstractVirtualFileHandler
VirtualFileHandler.removeChild(String)
of the parent
delete
in interface VirtualFileHandler
delete
in class AbstractVirtualFileHandler
gracePeriod
- max time to wait for any locks
java.io.IOException
- if an error occurspublic VirtualFileHandler createChildHandler(java.lang.String name) throws java.io.IOException
StructuredVirtualFileHandler
createChildHandler
in interface StructuredVirtualFileHandler
name
- the name
java.io.IOException
- for any error accessing the virtual file systemprotected void internalReplaceChild(VirtualFileHandler original, VirtualFileHandler replacement)
AbstractVirtualFileHandler
internalReplaceChild
in class AbstractVirtualFileHandler
original
- the originalreplacement
- the replacementprotected java.net.URL toInternalVfsUrl()
AbstractVirtualFileHandler
toInternalVfsUrl
in class AbstractVirtualFileHandler
public java.net.URL getRealURL() throws java.io.IOException, java.net.URISyntaxException
VirtualFileHandler
getRealURL
in interface VirtualFileHandler
getRealURL
in class AbstractVirtualFileHandler
java.net.MalformedURLException
- for any error constructing the URL
java.net.URISyntaxException
- for an error parsing the URI
java.io.IOException
public java.security.cert.Certificate[] getCertificates()
VirtualFileHandler
getCertificates
in interface VirtualFileHandler
getCertificates
in class AbstractVirtualFileHandler
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |