|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface VirtualFileHandler
A virtual file handler
Method Summary | |
---|---|
void |
cleanup()
Cleanup resources. |
void |
close()
Close the resources |
boolean |
delete(int gracePeriod)
Delete a file represented by this handler |
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 |
long |
getLastModified()
When the file was last modified |
String |
getLocalPathName()
Get the VFS local path name. |
String |
getName()
Get the simple VF name (X.java) |
VirtualFileHandler |
getParent()
Get the parent |
String |
getPathName()
Get the VFS relative path name (org/jboss/X.java) |
URL |
getRealURL()
Get a file: or jar:file: URL representing a resource as precisely as possible. |
long |
getSize()
Get the size |
VFSContext |
getVFSContext()
Get the VFSContext this file belongs to |
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. |
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 name)
Remove a child |
void |
replaceChild(VirtualFileHandler original,
VirtualFileHandler replacement)
Replace child. |
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 |
Method Detail |
---|
String getName()
String getPathName()
String getLocalPathName()
URL toVfsUrl() throws MalformedURLException, URISyntaxException
URISyntaxException
- for an error parsing the URI
MalformedURLException
- for any errorURL getRealURL() throws IOException, URISyntaxException
URISyntaxException
- for an error parsing the URI
MalformedURLException
- for any error constructing the URL
IOException
URI toURI() throws URISyntaxException
URISyntaxException
- for an error parsing the URIURL toURL() throws MalformedURLException, URISyntaxException
URISyntaxException
- for an error parsing the URI
MalformedURLException
- for any errorlong getLastModified() throws IOException
IOException
- for any problem accessing the virtual file system
IllegalStateException
- if closedboolean hasBeenModified() throws IOException
IOException
- for any errorlong getSize() throws IOException
IOException
- for any problem accessing the virtual file system
IllegalStateException
- if closedboolean exists() throws IOException
IOException
- - thrown on failure to detect existence.boolean isLeaf() throws IOException
IOException
- for any problem accessing the virtual file system
IllegalStateException
- if the file is closedboolean isArchive() throws IOException
IOException
- for any problem accessing the virtual file systemboolean isHidden() throws IOException
IOException
- for any problem accessing the virtual file system
IllegalStateException
- if closedInputStream openStream() throws IOException
IOException
- for any problem accessing the virtual file system
IllegalStateException
- if closedVirtualFileHandler getParent() throws IOException
IOException
- for an error accessing the file system
IllegalStateException
- if closedList<VirtualFileHandler> getChildren(boolean ignoreErrors) throws IOException
ignoreErrors
- whether to ignore errors
IOException
- for an error accessing the file system
IllegalStateException
- if closedVirtualFileHandler getChild(String path) throws IOException
path
- the path
null
if not found
IOException
- for an error accessing the file system
IllegalStateException
- if closedboolean removeChild(String name) throws IOException
name
- child name
IllegalStateException
- if closed
IOException
- if an error occursVFSContext getVFSContext()
IllegalStateException
- if closedVirtualFile getVirtualFile()
IllegalStateException
- if closedvoid cleanup()
void close()
void replaceChild(VirtualFileHandler original, VirtualFileHandler replacement)
original
- the originalreplacement
- the replacementboolean isNested() throws IOException
IOException
- for any errorboolean delete(int gracePeriod) throws IOException
gracePeriod
- max time to wait for locks (in milliseconds)
IOException
- for any error
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |