|
||||||||||
| 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.AbstractURLHandler
org.jboss.virtual.plugins.context.file.FileHandler
public class FileHandler
FileHandler.
| Field Summary |
|---|
| Fields inherited from class org.jboss.virtual.plugins.context.AbstractVirtualFileHandler |
|---|
cachedLastModified, log |
| Constructor Summary | |
|---|---|
FileHandler(FileSystemContext context,
VirtualFileHandler parent,
File file,
URI uri)
Create a new FileHandler |
|
FileHandler(FileSystemContext context,
VirtualFileHandler parent,
File file,
URL url)
Create a new FileHandler. |
|
| Method Summary | |
|---|---|
void |
cleanup()
Cleanup resources. |
VirtualFileHandler |
createChildHandler(String name)
Create a virtual file context |
boolean |
delete(int gracePeriod)
Delete the file represented by this handler. |
boolean |
exists()
Basis existence on URLConnection.getLastModified() != 0. |
VirtualFileHandler |
getChild(String path)
Get a child |
List<VirtualFileHandler> |
getChildren(boolean ignoreErrors)
Get the children |
protected File |
getFile()
Get the file for this file handler |
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 |
FileSystemContext |
getVFSContext()
Get this handler's most outer context (contexts can be mounted one within other). |
protected void |
initCacheLastModified()
|
protected void |
internalReplaceChild(VirtualFileHandler original,
VirtualFileHandler replacement)
Replace original child with unpacked replacement. |
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. |
boolean |
removeChild(String name)
Remove a child |
protected URL |
toInternalVfsUrl()
Get internal representation of vfs url. |
| Methods inherited from class org.jboss.virtual.plugins.context.AbstractURLHandler |
|---|
getURL, openConnection, openConnection, openStream, toURI, toURL |
| Methods inherited from class org.jboss.virtual.plugins.context.AbstractVirtualFileHandler |
|---|
checkClosed, checkParentExists, close, decrement, doClose, equals, getChildPathName, getChildVfsUrl, getLocalPathName, getLocalVFSContext, getName, getParent, getPathName, getReferences, getVfsUrl, getVirtualFile, hasBeenModified, hashCode, increment, isArchive, isTemporary, replaceChild, setPathName, setVfsUrl, simpleFindChild, structuredFindChild, toString, toStringLocal, toVfsUrl |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public FileHandler(FileSystemContext context,
VirtualFileHandler parent,
File file,
URL url)
throws IOException
context - the contextparent - the parentfile - the fileurl - the url
IOException - for an error accessing the file system
IllegalArgumentException - for a null context, url
public FileHandler(FileSystemContext context,
VirtualFileHandler parent,
File file,
URI uri)
throws IOException
context - the contextparent - the parentfile - the fileuri - the uri
IOException - for an error accessing the file system
IllegalArgumentException - for a null context, uri| Method Detail |
|---|
protected void initCacheLastModified()
initCacheLastModified in class AbstractURLHandler
protected URL toInternalVfsUrl()
throws MalformedURLException,
URISyntaxException
AbstractVirtualFileHandler
toInternalVfsUrl in class AbstractVirtualFileHandlerMalformedURLException - for any error
URISyntaxException - for any error
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 FileSystemContext getVFSContext()
AbstractVirtualFileHandler
getVFSContext in interface VirtualFileHandlergetVFSContext in class AbstractVirtualFileHandlerprotected File getFile()
public long getLastModified()
VirtualFileHandler
getLastModified in interface VirtualFileHandlergetLastModified in class AbstractURLHandler
public boolean exists()
throws IOException
AbstractURLHandler
exists in interface VirtualFileHandlerexists in class AbstractURLHandlerIOException - - thrown on failure to detect existence.URLConnection.getLastModified(),
org.jboss.test.virtual.test.URLExistsUnitTestCasepublic long getSize()
VirtualFileHandler
getSize in interface VirtualFileHandlergetSize in class AbstractURLHandlerpublic boolean isLeaf()
VirtualFileHandler
isLeaf in interface VirtualFileHandlerpublic boolean isHidden()
VirtualFileHandler
isHidden in interface VirtualFileHandlerisHidden in class AbstractURLHandler
public boolean isNested()
throws IOException
VirtualFileHandler
isNested in interface VirtualFileHandlerIOException - for any errorpublic void cleanup()
VirtualFileHandler
cleanup in interface VirtualFileHandlercleanup 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 List<VirtualFileHandler> getChildren(boolean ignoreErrors)
throws IOException
VirtualFileHandler
getChildren in interface VirtualFileHandlerignoreErrors - whether to ignore errors
IOException - for an error accessing the file system
public VirtualFileHandler createChildHandler(String name)
throws IOException
StructuredVirtualFileHandler
createChildHandler in interface StructuredVirtualFileHandlername - the name
IOException - for any error accessing the virtual file system
public VirtualFileHandler getChild(String path)
throws IOException
VirtualFileHandler
getChild in interface VirtualFileHandlerpath - the path
null if not found
IOException - for an error accessing the file system
public boolean removeChild(String name)
throws IOException
VirtualFileHandler
removeChild in interface VirtualFileHandlername - child name
IOException - if an error occurs
protected void internalReplaceChild(VirtualFileHandler original,
VirtualFileHandler replacement)
AbstractVirtualFileHandler
internalReplaceChild in class AbstractVirtualFileHandleroriginal - the originalreplacement - the replacement
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||