|
||||||||||
| 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 VFS
public 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 delegate| Method Detail |
|---|
public void setDelegate(VirtualFileHandler handler)
public VirtualFileHandler getDelegate()
protected void setVfsUrl(URL vfsUrl)
setVfsUrl in class AbstractVirtualFileHandlervfsUrl - the vfs url
public VirtualFileHandler getChild(String path)
throws IOException
VirtualFileHandler
path - the path
null if not found
IOException - for an error accessing the file system
public boolean removeChild(String path)
throws IOException
VirtualFileHandler
path - child name
IOException - if an error occurs
public List<VirtualFileHandler> getChildren(boolean ignoreErrors)
throws IOException
VirtualFileHandler
ignoreErrors - whether to ignore errors
IOException - for an error accessing the file system
public long getLastModified()
throws IOException
VirtualFileHandler
IOException - for any problem accessing the virtual file system
public long getSize()
throws IOException
VirtualFileHandler
IOException - for any problem accessing the virtual file system
public boolean isLeaf()
throws IOException
VirtualFileHandler
IOException - for any problem accessing the virtual file system
public boolean isArchive()
throws IOException
VirtualFileHandler
isArchive in interface VirtualFileHandlerisArchive in class AbstractVirtualFileHandlerIOException - for any problem accessing the virtual file system
public 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 system
public boolean isNested()
throws IOException
VirtualFileHandler
IOException - for any errorpublic void cleanup()
VirtualFileHandler
cleanup in interface VirtualFileHandlercleanup in class AbstractVirtualFileHandlerpublic void close()
VirtualFileHandler
close in interface VirtualFileHandlerclose in class AbstractVirtualFileHandler
public boolean delete(int gracePeriod)
throws IOException
AbstractVirtualFileHandlerVirtualFileHandler.removeChild(String) of the parent
delete in interface VirtualFileHandlerdelete in class AbstractVirtualFileHandlergracePeriod - max time to wait for any locks
IOException - if an error occurs
public InputStream openStream()
throws IOException
VirtualFileHandler
IOException - for any problem accessing the virtual file system
public URI toURI()
throws URISyntaxException
VirtualFileHandler
URISyntaxException - for an error parsing the URI
public URL toURL()
throws URISyntaxException,
MalformedURLException
VirtualFileHandler
toURL in interface VirtualFileHandlertoURL in class AbstractVirtualFileHandlerURISyntaxException - for an error parsing the URI
MalformedURLException - for any error
protected void internalReplaceChild(VirtualFileHandler original,
VirtualFileHandler replacement)
AbstractVirtualFileHandler
internalReplaceChild in class AbstractVirtualFileHandleroriginal - the originalreplacement - the replacement
public URL toVfsUrl()
throws MalformedURLException,
URISyntaxException
VirtualFileHandler
toVfsUrl in interface VirtualFileHandlertoVfsUrl in class AbstractVirtualFileHandlerMalformedURLException - for any error
URISyntaxException - for an error parsing the URI
public URL getRealURL()
throws IOException,
URISyntaxException
VirtualFileHandler
getRealURL in interface VirtualFileHandlergetRealURL in class AbstractVirtualFileHandlerMalformedURLException - for any error constructing the URL
URISyntaxException - for an error parsing the URI
IOExceptionpublic int hashCode()
hashCode in class AbstractVirtualFileHandlerpublic boolean equals(Object o)
equals in class AbstractVirtualFileHandler
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||