|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.virtual.plugins.context.AbstractVirtualFileHandler
public abstract class AbstractVirtualFileHandler
AbstractVirtualFileHandler.
| Field Summary | |
|---|---|
protected long |
cachedLastModified
The cached last modified |
protected static org.jboss.logging.Logger |
log
The log |
| Constructor Summary | |
|---|---|
protected |
AbstractVirtualFileHandler(VFSContext context,
VirtualFileHandler parent,
String name)
Create a new handler |
| Method Summary | |
|---|---|
protected void |
checkClosed()
Check whether we are closed |
protected void |
checkParentExists()
Check if parent exists. |
void |
cleanup()
Cleanup resources. |
void |
close()
Close the resources |
protected int |
decrement()
Decrement the reference count |
boolean |
delete(int gracePeriod)
Delete the file represented by this handler. |
protected void |
doClose()
The real close |
boolean |
equals(Object obj)
|
protected String |
getChildPathName(String childPath,
boolean isDirectory)
Get child path name. |
protected URL |
getChildVfsUrl(String childPath,
boolean isDirectory)
Get child url. |
String |
getLocalPathName()
Get a pathName relative to local context |
VFSContext |
getLocalVFSContext()
Get this handler's local context |
String |
getName()
Get the simple VF name (X.java) |
VirtualFileHandler |
getParent()
Get this handler's parent. |
String |
getPathName()
Get a pathName relative to most outer context (contexts can be mounted one within other) |
URL |
getRealURL()
Get a file: or jar:file: URL representing a resource as precisely as possible. |
protected int |
getReferences()
Get the references count. |
VFSContext |
getVFSContext()
Get this handler's most outer context (contexts can be mounted one within other). |
protected URL |
getVfsUrl()
Get VFS url. |
VirtualFile |
getVirtualFile()
Get the virtual file wrapper |
boolean |
hasBeenModified()
Returns true if the file has been modified since this method was last called Last modified time is initialized at handler instantiation. |
int |
hashCode()
|
protected int |
increment()
Increment the reference count |
protected void |
internalReplaceChild(VirtualFileHandler original,
VirtualFileHandler replacement)
Replace original child with unpacked replacement. |
boolean |
isArchive()
Does this represent an archive. |
protected boolean |
isTemporary()
Is the handler temporary. |
void |
replaceChild(VirtualFileHandler original,
VirtualFileHandler replacement)
Replace child. |
void |
setPathName(String path)
todo This is a hack until we can fix http://jira.jboss.com/jira/browse/JBMICROCONT-164 |
protected void |
setVfsUrl(URL vfsUrl)
Set the vfs URL. |
VirtualFileHandler |
simpleFindChild(String path)
Simple implementation of findChild |
VirtualFileHandler |
structuredFindChild(String path)
Structured implementation of get child |
protected URL |
toInternalVfsUrl()
Get internal representation of vfs url. |
String |
toString()
|
String |
toStringLocal()
|
URL |
toURL()
Get the VF URL (file://root/org/jboss/X.java) |
URL |
toVfsUrl()
Get a VFS-based URL |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.jboss.virtual.spi.VirtualFileHandler |
|---|
exists, getChild, getChildren, getLastModified, getSize, isHidden, isLeaf, isNested, openStream, removeChild, toURI |
| Field Detail |
|---|
protected static final org.jboss.logging.Logger log
protected transient long cachedLastModified
| Constructor Detail |
|---|
protected AbstractVirtualFileHandler(VFSContext context,
VirtualFileHandler parent,
String name)
context - the contextparent - the parentname - the name
IllegalArgumentException - if the context or name is null;| Method Detail |
|---|
protected void checkParentExists()
protected URL getChildVfsUrl(String childPath,
boolean isDirectory)
throws IOException,
URISyntaxException
childPath - the child pathisDirectory - is directory
IOException - for any io error
URISyntaxException - for any uri error
protected String getChildPathName(String childPath,
boolean isDirectory)
throws IOException
childPath - the child pathisDirectory - is directory
IOException - for any io error
public boolean isArchive()
throws IOException
VirtualFileHandler
isArchive in interface VirtualFileHandlerIOException - for any problem accessing the virtual file system
public boolean hasBeenModified()
throws IOException
VirtualFileHandler
hasBeenModified in interface VirtualFileHandlerIOException - for any errorpublic String getName()
VirtualFileHandler
getName in interface VirtualFileHandlerpublic String getPathName()
getPathName in interface VirtualFileHandlerpublic void setPathName(String path)
path - the path namepublic String getLocalPathName()
getLocalPathName in interface VirtualFileHandler
public URL toURL()
throws MalformedURLException,
URISyntaxException
VirtualFileHandler
toURL in interface VirtualFileHandlerMalformedURLException - for any error
URISyntaxException - for an error parsing the URI
public URL toVfsUrl()
throws MalformedURLException,
URISyntaxException
VirtualFileHandler
toVfsUrl in interface VirtualFileHandlerMalformedURLException - for any error
URISyntaxException - for an error parsing the URI
protected URL toInternalVfsUrl()
throws MalformedURLException,
URISyntaxException
MalformedURLException - for any error
URISyntaxException - for any error
public URL getRealURL()
throws IOException,
URISyntaxException
VirtualFileHandler
getRealURL in interface VirtualFileHandlerMalformedURLException - for any error constructing the URL
URISyntaxException - for an error parsing the URI
IOExceptionprotected URL getVfsUrl()
protected void setVfsUrl(URL vfsUrl)
vfsUrl - vfs urlpublic VirtualFile getVirtualFile()
VirtualFileHandler
getVirtualFile in interface VirtualFileHandler
public VirtualFileHandler getParent()
throws IOException
getParent in interface VirtualFileHandlerIOException - for any errorpublic VFSContext getVFSContext()
getVFSContext in interface VirtualFileHandlerpublic VFSContext getLocalVFSContext()
protected int increment()
protected int decrement()
protected void checkClosed()
throws IllegalStateException
IllegalStateException - when closedprotected int getReferences()
public void cleanup()
VirtualFileHandler
cleanup in interface VirtualFileHandlerprotected boolean isTemporary()
public void close()
VirtualFileHandler
close in interface VirtualFileHandlerprotected void doClose()
public boolean delete(int gracePeriod)
throws IOException
VirtualFileHandler.removeChild(String) of the parent
delete in interface VirtualFileHandlergracePeriod - max time to wait for any locks
IOException - if an error occurs
public VirtualFileHandler structuredFindChild(String path)
throws IOException
path - the path
null if it doesn't exist
IOException - for any error accessing the virtual file system
IllegalArgumentException - for a null name
public VirtualFileHandler simpleFindChild(String path)
throws IOException
path - the path
IOException - for any error accessing the virtual file system
IllegalArgumentException - for a null name
public void replaceChild(VirtualFileHandler original,
VirtualFileHandler replacement)
VirtualFileHandler
replaceChild in interface VirtualFileHandleroriginal - the originalreplacement - the replacement
protected void internalReplaceChild(VirtualFileHandler original,
VirtualFileHandler replacement)
original - the originalreplacement - the replacementpublic String toString()
toString in class Objectpublic String toStringLocal()
public int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||