|
||||||||||
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,
String name)
Create a DelegatingHandler without a delegate - which will have to be set afterwards |
|
DelegatingHandler(VFSContext context,
VirtualFileHandler parent,
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(Object o)
|
boolean |
exists()
Tests whether the underlying implementation file still exists. |
VirtualFileHandler |
getChild(String path)
Get a child |
List<VirtualFileHandler> |
getChildren(boolean ignoreErrors)
Get the children |
VirtualFileHandler |
getDelegate()
|
long |
getLastModified()
When the file was last modified |
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. |
InputStream |
openStream()
Access the file contents. |
boolean |
removeChild(String path)
Remove a child |
void |
setDelegate(VirtualFileHandler handler)
|
protected void |
setVfsUrl(URL vfsUrl)
Set the vfs url. |
URI |
toURI()
Get the VF URI (file://root/org/jboss/X.java) |
URL |
toURL()
Get the VF URL (file://root/org/jboss/X.java) |
URL |
toVfsUrl()
Get a VFS-based URL |
Methods inherited from class org.jboss.virtual.plugins.context.AbstractVirtualFileHandler |
---|
checkClosed, checkParentExists, decrement, doClose, 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, 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, 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(URL vfsUrl)
setVfsUrl
in class AbstractVirtualFileHandler
vfsUrl
- the vfs urlpublic VirtualFileHandler getChild(String path) throws IOException
VirtualFileHandler
path
- the path
null
if not found
IOException
- for an error accessing the file systempublic boolean removeChild(String path) throws IOException
VirtualFileHandler
path
- child name
IOException
- if an error occurspublic List<VirtualFileHandler> getChildren(boolean ignoreErrors) throws IOException
VirtualFileHandler
ignoreErrors
- whether to ignore errors
IOException
- for an error accessing the file systempublic long getLastModified() throws IOException
VirtualFileHandler
IOException
- for any problem accessing the virtual file systempublic long getSize() throws IOException
VirtualFileHandler
IOException
- for any problem accessing the virtual file systempublic boolean isLeaf() throws IOException
VirtualFileHandler
IOException
- for any problem accessing the virtual file systempublic boolean isArchive() throws IOException
VirtualFileHandler
isArchive
in interface VirtualFileHandler
isArchive
in class AbstractVirtualFileHandler
IOException
- for any problem accessing the virtual file systempublic boolean exists() throws IOException
VirtualFileHandler
IOException
- - thrown on failure to detect existence.public boolean isHidden() throws IOException
VirtualFileHandler
IOException
- for any problem accessing the virtual file systempublic boolean isNested() throws IOException
VirtualFileHandler
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 IOException
AbstractVirtualFileHandler
VirtualFileHandler.removeChild(String)
of the parent
delete
in interface VirtualFileHandler
delete
in class AbstractVirtualFileHandler
gracePeriod
- max time to wait for any locks
IOException
- if an error occurspublic InputStream openStream() throws IOException
VirtualFileHandler
IOException
- for any problem accessing the virtual file systempublic URI toURI() throws URISyntaxException
VirtualFileHandler
URISyntaxException
- for an error parsing the URIpublic URL toURL() throws URISyntaxException, MalformedURLException
VirtualFileHandler
toURL
in interface VirtualFileHandler
toURL
in class AbstractVirtualFileHandler
URISyntaxException
- for an error parsing the URI
MalformedURLException
- for any errorprotected void internalReplaceChild(VirtualFileHandler original, VirtualFileHandler replacement)
AbstractVirtualFileHandler
internalReplaceChild
in class AbstractVirtualFileHandler
original
- the originalreplacement
- the replacementpublic URL toVfsUrl() throws MalformedURLException, URISyntaxException
VirtualFileHandler
toVfsUrl
in interface VirtualFileHandler
toVfsUrl
in class AbstractVirtualFileHandler
MalformedURLException
- for any error
URISyntaxException
- for an error parsing the URIpublic URL getRealURL() throws IOException, URISyntaxException
VirtualFileHandler
getRealURL
in interface VirtualFileHandler
getRealURL
in class AbstractVirtualFileHandler
MalformedURLException
- for any error constructing the URL
URISyntaxException
- for an error parsing the URI
IOException
public int hashCode()
hashCode
in class AbstractVirtualFileHandler
public boolean equals(Object o)
equals
in class AbstractVirtualFileHandler
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |