|
||||||||||
| 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(java.lang.Object obj)
|
boolean |
exists()
Tests whether the underlying implementation file still exists. |
VirtualFile |
findChild(java.lang.String path)
Find a child |
java.util.List<VirtualFile> |
getChildren()
Get the children |
java.util.List<VirtualFile> |
getChildren(VirtualFileFilter filter)
Get the children |
java.util.List<VirtualFile> |
getChildrenRecursively()
Get all the children recursively |
java.util.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 |
java.lang.String |
getName()
Get the simple VF name (X.java) |
VirtualFile |
getParent()
Get the parent |
java.lang.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. |
java.io.InputStream |
openStream()
Access the file contents. |
java.lang.String |
toString()
|
java.net.URI |
toURI()
Get the VF URI (file://root/org/jboss/X.java) |
java.net.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
java.lang.IllegalArgumentException - if the handler is null| Method Detail |
|---|
public VirtualFileHandler getHandler()
java.lang.IllegalStateException - if the file is closedpublic java.lang.String getName()
java.lang.IllegalStateException - if the file is closedpublic java.lang.String getPathName()
java.lang.IllegalStateException - if the file is closed
public java.net.URL toURL()
throws java.net.MalformedURLException,
java.net.URISyntaxException
java.net.MalformedURLException - if a url cannot be parsed
java.net.URISyntaxException - if a uri cannot be parsed
java.lang.IllegalStateException - if the file is closed
public java.net.URI toURI()
throws java.net.MalformedURLException,
java.net.URISyntaxException
java.net.URISyntaxException - if a uri cannot be parsed
java.lang.IllegalStateException - if the file is closed
java.net.MalformedURLException - for a bad url
public long getLastModified()
throws java.io.IOException
java.io.IOException - for any problem accessing the virtual file system
java.lang.IllegalStateException - if the file is closed
public boolean hasBeenModified()
throws java.io.IOException
java.io.IOException
public long getSize()
throws java.io.IOException
java.io.IOException - for any problem accessing the virtual file system
java.lang.IllegalStateException - if the file is closed
public boolean exists()
throws java.io.IOException
java.io.IOException - - thrown on failure to detect existence.
public boolean isLeaf()
throws java.io.IOException
java.io.IOException - for any problem accessing the virtual file system
java.lang.IllegalStateException - if the file is closed
public boolean isHidden()
throws java.io.IOException
java.io.IOException - for any problem accessing the virtual file system
java.lang.IllegalStateException - if the file is closed
public java.io.InputStream openStream()
throws java.io.IOException
java.io.IOException - for any error accessing the file system
java.lang.IllegalStateException - if the file is closedpublic void closeStreams()
public void close()
public VFS getVFS()
java.lang.IllegalStateException - if the file is closed
public VirtualFile getParent()
throws java.io.IOException
java.io.IOException - for any problem accessing the virtual file system
java.lang.IllegalStateException - if the file is closed
public java.util.List<VirtualFile> getChildren()
throws java.io.IOException
java.io.IOException - for any problem accessing the virtual file system
java.lang.IllegalStateException - if the file is closed
public java.util.List<VirtualFile> getChildren(VirtualFileFilter filter)
throws java.io.IOException
filter - to filter the children
java.io.IOException - for any problem accessing the virtual file system
java.lang.IllegalStateException - if the file is closed or it is a leaf node
public java.util.List<VirtualFile> getChildrenRecursively()
throws java.io.IOException
This always uses VisitorAttributes.RECURSE
java.io.IOException - for any problem accessing the virtual file system
java.lang.IllegalStateException - if the file is closed
public java.util.List<VirtualFile> getChildrenRecursively(VirtualFileFilter filter)
throws java.io.IOException
This always uses VisitorAttributes.RECURSE
filter - to filter the children
java.io.IOException - for any problem accessing the virtual file system
java.lang.IllegalStateException - if the file is closed or it is a leaf node
public void visit(VirtualFileVisitor visitor)
throws java.io.IOException
visitor - the visitor
java.io.IOException - for any problem accessing the virtual file system
java.lang.IllegalArgumentException - if the visitor is null
java.lang.IllegalStateException - if the file is closed or it is a leaf node
public VirtualFile findChild(java.lang.String path)
throws java.io.IOException
path - the path
java.io.IOException - for any problem accessing the VFS (including the child does not exist)
java.lang.IllegalArgumentException - if the path is null
java.lang.IllegalStateException - if the file is closed or it is a leaf nodepublic java.lang.String toString()
toString in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic 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 | |||||||||