|
||||||||||
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,
java.lang.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(java.lang.Object obj)
|
java.security.cert.Certificate[] |
getCertificates()
Get certificates. |
protected java.lang.String |
getChildPathName(java.lang.String childPath,
boolean isDirectory)
Get child path name. |
protected java.net.URL |
getChildVfsUrl(java.lang.String childPath,
boolean isDirectory)
Get child url. |
java.lang.String |
getLocalPathName()
Get a pathName relative to local context |
VFSContext |
getLocalVFSContext()
Get this handler's local context |
java.lang.String |
getName()
Get the simple VF name (X.java) |
VirtualFileHandler |
getParent()
Get this handler's parent. |
java.lang.String |
getPathName()
Get a pathName relative to most outer context (contexts can be mounted one within other) |
java.net.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 java.net.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(java.lang.String path)
todo This is a hack until we can fix http://jira.jboss.com/jira/browse/JBMICROCONT-164 |
protected void |
setVfsUrl(java.net.URL vfsUrl)
Set the vfs URL. |
VirtualFileHandler |
simpleFindChild(java.lang.String path)
Simple implementation of findChild |
VirtualFileHandler |
structuredFindChild(java.lang.String path)
Structured implementation of get child |
protected java.net.URL |
toInternalVfsUrl()
Get internal representation of vfs url. |
java.lang.String |
toString()
|
java.lang.String |
toStringLocal()
|
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 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, java.lang.String name)
context
- the contextparent
- the parentname
- the name
java.lang.IllegalArgumentException
- if the context or name is null;Method Detail |
---|
protected void checkParentExists()
protected java.net.URL getChildVfsUrl(java.lang.String childPath, boolean isDirectory) throws java.io.IOException, java.net.URISyntaxException
childPath
- the child pathisDirectory
- is directory
java.io.IOException
- for any io error
java.net.URISyntaxException
- for any uri errorprotected java.lang.String getChildPathName(java.lang.String childPath, boolean isDirectory) throws java.io.IOException
childPath
- the child pathisDirectory
- is directory
java.io.IOException
- for any io errorpublic boolean isArchive() throws java.io.IOException
VirtualFileHandler
isArchive
in interface VirtualFileHandler
java.io.IOException
- for any problem accessing the virtual file systempublic boolean hasBeenModified() throws java.io.IOException
VirtualFileHandler
hasBeenModified
in interface VirtualFileHandler
java.io.IOException
- for any errorpublic java.lang.String getName()
VirtualFileHandler
getName
in interface VirtualFileHandler
public java.lang.String getPathName()
getPathName
in interface VirtualFileHandler
public void setPathName(java.lang.String path)
path
- the path namepublic java.lang.String getLocalPathName()
getLocalPathName
in interface VirtualFileHandler
public java.net.URL toURL() throws java.net.MalformedURLException, java.net.URISyntaxException
VirtualFileHandler
toURL
in interface VirtualFileHandler
java.net.MalformedURLException
- for any error
java.net.URISyntaxException
- for an error parsing the URIpublic java.net.URL toVfsUrl() throws java.net.MalformedURLException, java.net.URISyntaxException
VirtualFileHandler
toVfsUrl
in interface VirtualFileHandler
java.net.MalformedURLException
- for any error
java.net.URISyntaxException
- for an error parsing the URIprotected java.net.URL toInternalVfsUrl() throws java.net.MalformedURLException, java.net.URISyntaxException
java.net.MalformedURLException
- for any error
java.net.URISyntaxException
- for any errorpublic java.net.URL getRealURL() throws java.io.IOException, java.net.URISyntaxException
VirtualFileHandler
getRealURL
in interface VirtualFileHandler
java.net.MalformedURLException
- for any error constructing the URL
java.net.URISyntaxException
- for an error parsing the URI
java.io.IOException
protected java.net.URL getVfsUrl()
protected void setVfsUrl(java.net.URL vfsUrl)
vfsUrl
- vfs urlpublic VirtualFile getVirtualFile()
VirtualFileHandler
getVirtualFile
in interface VirtualFileHandler
public VirtualFileHandler getParent() throws java.io.IOException
getParent
in interface VirtualFileHandler
java.io.IOException
- for any errorpublic VFSContext getVFSContext()
getVFSContext
in interface VirtualFileHandler
public VFSContext getLocalVFSContext()
protected int increment()
protected int decrement()
protected void checkClosed() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- when closedprotected int getReferences()
public void cleanup()
VirtualFileHandler
cleanup
in interface VirtualFileHandler
protected boolean isTemporary()
public void close()
VirtualFileHandler
close
in interface VirtualFileHandler
protected void doClose()
public boolean delete(int gracePeriod) throws java.io.IOException
VirtualFileHandler.removeChild(String)
of the parent
delete
in interface VirtualFileHandler
gracePeriod
- max time to wait for any locks
java.io.IOException
- if an error occurspublic java.security.cert.Certificate[] getCertificates()
VirtualFileHandler
getCertificates
in interface VirtualFileHandler
public VirtualFileHandler structuredFindChild(java.lang.String path) throws java.io.IOException
path
- the path
null
if it doesn't exist
java.io.IOException
- for any error accessing the virtual file system
java.lang.IllegalArgumentException
- for a null namepublic VirtualFileHandler simpleFindChild(java.lang.String path) throws java.io.IOException
path
- the path
java.io.IOException
- for any error accessing the virtual file system
java.lang.IllegalArgumentException
- for a null namepublic void replaceChild(VirtualFileHandler original, VirtualFileHandler replacement)
VirtualFileHandler
replaceChild
in interface VirtualFileHandler
original
- the originalreplacement
- the replacementprotected void internalReplaceChild(VirtualFileHandler original, VirtualFileHandler replacement)
original
- the originalreplacement
- the replacementpublic java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toStringLocal()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |