|
||||||||||
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.DelegatingHandler
public class DelegatingHandler
A delegating VirtualFileHandler that allows for overriding the delegate parent and name. One usecase is a link which roots another VFSContext under a different parent and name.
Field Summary |
---|
Fields inherited from class org.jboss.virtual.plugins.context.AbstractVirtualFileHandler |
---|
cachedLastModified, log |
Constructor Summary | |
---|---|
DelegatingHandler(VFSContext context,
VirtualFileHandler parent,
java.lang.String name)
Create a DelegatingHandler without a delegate - which will have to be set afterwards |
|
DelegatingHandler(VFSContext context,
VirtualFileHandler parent,
java.lang.String name,
VirtualFileHandler delegate)
Create a DelegatingHandler |
Method Summary | |
---|---|
void |
cleanup()
Cleanup resources. |
void |
close()
Close the resources |
boolean |
delete(int gracePeriod)
Delete the file represented by this handler. |
boolean |
equals(java.lang.Object o)
|
boolean |
exists()
Tests whether the underlying implementation file still exists. |
VirtualFileHandler |
getChild(java.lang.String path)
Get a child |
java.util.List<VirtualFileHandler> |
getChildren(boolean ignoreErrors)
Get the children |
VirtualFileHandler |
getDelegate()
|
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 |
int |
hashCode()
|
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 path)
Remove a child |
void |
setDelegate(VirtualFileHandler handler)
|
protected void |
setVfsUrl(java.net.URL vfsUrl)
Set the vfs url. |
java.net.URI |
toURI()
Get the VF URI (file://root/org/jboss/X.java) |
java.net.URL |
toURL()
Get the VF URL (file://root/org/jboss/X.java) |
java.net.URL |
toVfsUrl()
Get a VFS-based URL |
Methods inherited from class org.jboss.virtual.plugins.context.AbstractVirtualFileHandler |
---|
checkClosed, checkParentExists, decrement, doClose, getCertificates, getChildPathName, getChildVfsUrl, getLocalPathName, getLocalVFSContext, getName, getParent, getPathName, getReferences, getVFSContext, getVfsUrl, getVirtualFile, hasBeenModified, increment, isTemporary, replaceChild, setPathName, simpleFindChild, structuredFindChild, toInternalVfsUrl, toString, toStringLocal |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DelegatingHandler(VFSContext context, VirtualFileHandler parent, java.lang.String name)
context
- - the context for the parentparent
- - the parent of the delegate in this VFSname
- - the name of the delegate in this VFSpublic DelegatingHandler(VFSContext context, VirtualFileHandler parent, java.lang.String name, VirtualFileHandler delegate)
context
- - the context for the parentparent
- - the parent of the delegate in this VFSname
- - the name of the delegate in this VFSdelegate
- - the handler delegateMethod Detail |
---|
public void setDelegate(VirtualFileHandler handler)
public VirtualFileHandler getDelegate()
protected void setVfsUrl(java.net.URL vfsUrl)
setVfsUrl
in class AbstractVirtualFileHandler
vfsUrl
- the vfs urlpublic VirtualFileHandler getChild(java.lang.String path) throws java.io.IOException
VirtualFileHandler
path
- the path
null
if not found
java.io.IOException
- for an error accessing the file systempublic boolean removeChild(java.lang.String path) throws java.io.IOException
VirtualFileHandler
path
- child name
java.io.IOException
- if an error occurspublic java.util.List<VirtualFileHandler> getChildren(boolean ignoreErrors) throws java.io.IOException
VirtualFileHandler
ignoreErrors
- whether to ignore errors
java.io.IOException
- for an error accessing the file systempublic long getLastModified() throws java.io.IOException
VirtualFileHandler
java.io.IOException
- for any problem accessing the virtual file systempublic long getSize() throws java.io.IOException
VirtualFileHandler
java.io.IOException
- for any problem accessing the virtual file systempublic boolean isLeaf() throws java.io.IOException
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 exists() throws java.io.IOException
VirtualFileHandler
java.io.IOException
- - thrown on failure to detect existence.public boolean isHidden() throws java.io.IOException
VirtualFileHandler
java.io.IOException
- for any problem accessing the virtual file systempublic boolean isNested() throws java.io.IOException
VirtualFileHandler
java.io.IOException
- for any errorpublic void cleanup()
VirtualFileHandler
cleanup
in interface VirtualFileHandler
cleanup
in class AbstractVirtualFileHandler
public void close()
VirtualFileHandler
close
in interface VirtualFileHandler
close
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 java.io.InputStream openStream() throws java.io.IOException
VirtualFileHandler
java.io.IOException
- for any problem accessing the virtual file systempublic java.net.URI toURI() throws java.net.URISyntaxException
VirtualFileHandler
java.net.URISyntaxException
- for an error parsing the URIpublic java.net.URL toURL() throws java.net.URISyntaxException, java.net.MalformedURLException
VirtualFileHandler
toURL
in interface VirtualFileHandler
toURL
in class AbstractVirtualFileHandler
java.net.URISyntaxException
- for an error parsing the URI
java.net.MalformedURLException
- for any errorprotected void internalReplaceChild(VirtualFileHandler original, VirtualFileHandler replacement)
AbstractVirtualFileHandler
internalReplaceChild
in class AbstractVirtualFileHandler
original
- the originalreplacement
- the replacementpublic java.net.URL toVfsUrl() throws java.net.MalformedURLException, java.net.URISyntaxException
VirtualFileHandler
toVfsUrl
in interface VirtualFileHandler
toVfsUrl
in class AbstractVirtualFileHandler
java.net.MalformedURLException
- for any error
java.net.URISyntaxException
- for an error parsing the URIpublic 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 int hashCode()
hashCode
in class AbstractVirtualFileHandler
public boolean equals(java.lang.Object o)
equals
in class AbstractVirtualFileHandler
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |