|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.virtual.VirtualFile
public class VirtualFile
A virtual file as seen by the user
| Constructor Summary | |
|---|---|
VirtualFile(VirtualFileHandler handler)
Create a new VirtualFile. |
|
| Method Summary | |
|---|---|
void |
close()
Close the file resources (stream, etc.) |
void |
closeStreams()
Close the streams |
boolean |
equals(Object obj)
|
boolean |
exists()
Tests whether the underlying implementation file still exists. |
VirtualFile |
findChild(String path)
Find a child |
List<VirtualFile> |
getChildren()
Get the children |
List<VirtualFile> |
getChildren(VirtualFileFilter filter)
Get the children |
List<VirtualFile> |
getChildrenRecursively()
Get all the children recursively |
List<VirtualFile> |
getChildrenRecursively(VirtualFileFilter filter)
Get all the children recursively |
VirtualFileHandler |
getHandler()
Get the virtual file handler |
long |
getLastModified()
When the file was last modified |
String |
getName()
Get the simple VF name (X.java) |
VirtualFile |
getParent()
Get the parent |
String |
getPathName()
Get the VFS relative path name (org/jboss/X.java) |
long |
getSize()
Get the size |
VFS |
getVFS()
Get the VFS instance for this virtual file |
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()
|
boolean |
isHidden()
Whether it is hidden |
boolean |
isLeaf()
Whether it is a simple leaf of the VFS, i.e. |
InputStream |
openStream()
Access the file contents. |
String |
toString()
|
URI |
toURI()
Get the VF URI (file://root/org/jboss/X.java) |
URL |
toURL()
Get the VF URL (file://root/org/jboss/X.java) |
void |
visit(VirtualFileVisitor visitor)
Visit the virtual file system |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public VirtualFile(VirtualFileHandler handler)
handler - the handler
IllegalArgumentException - if the handler is null| Method Detail |
|---|
public VirtualFileHandler getHandler()
IllegalStateException - if the file is closedpublic String getName()
IllegalStateException - if the file is closedpublic String getPathName()
IllegalStateException - if the file is closed
public URL toURL()
throws MalformedURLException,
URISyntaxException
MalformedURLException - if a url cannot be parsed
URISyntaxException - if a uri cannot be parsed
IllegalStateException - if the file is closed
public URI toURI()
throws MalformedURLException,
URISyntaxException
URISyntaxException - if a uri cannot be parsed
IllegalStateException - if the file is closed
MalformedURLException - for a bad url
public long getLastModified()
throws IOException
IOException - for any problem accessing the virtual file system
IllegalStateException - if the file is closed
public boolean hasBeenModified()
throws IOException
IOException
public long getSize()
throws IOException
IOException - for any problem accessing the virtual file system
IllegalStateException - if the file is closed
public boolean exists()
throws IOException
IOException - - thrown on failure to detect existence.
public boolean isLeaf()
throws IOException
IOException - for any problem accessing the virtual file system
IllegalStateException - if the file is closed
public boolean isHidden()
throws IOException
IOException - for any problem accessing the virtual file system
IllegalStateException - if the file is closed
public InputStream openStream()
throws IOException
IOException - for any error accessing the file system
IllegalStateException - if the file is closedpublic void closeStreams()
public void close()
public VFS getVFS()
IllegalStateException - if the file is closed
public VirtualFile getParent()
throws IOException
IOException - for any problem accessing the virtual file system
IllegalStateException - if the file is closed
public List<VirtualFile> getChildren()
throws IOException
IOException - for any problem accessing the virtual file system
IllegalStateException - if the file is closed
public List<VirtualFile> getChildren(VirtualFileFilter filter)
throws IOException
filter - to filter the children
IOException - for any problem accessing the virtual file system
IllegalStateException - if the file is closed or it is a leaf node
public List<VirtualFile> getChildrenRecursively()
throws IOException
This always uses VisitorAttributes.RECURSE
IOException - for any problem accessing the virtual file system
IllegalStateException - if the file is closed
public List<VirtualFile> getChildrenRecursively(VirtualFileFilter filter)
throws IOException
This always uses VisitorAttributes.RECURSE
filter - to filter the children
IOException - for any problem accessing the virtual file system
IllegalStateException - if the file is closed or it is a leaf node
public void visit(VirtualFileVisitor visitor)
throws IOException
visitor - the visitor
IOException - for any problem accessing the virtual file system
IllegalArgumentException - if the visitor is null
IllegalStateException - if the file is closed or it is a leaf node
public VirtualFile findChild(String path)
throws IOException
path - the path
IOException - for any problem accessing the VFS (including the child does not exist)
IllegalArgumentException - if the path is null
IllegalStateException - if the file is closed or it is a leaf nodepublic String toString()
toString in class Objectpublic 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 | |||||||||