|
JBoss VFS 3.1.0.Final-redhat-2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.vfs.VirtualFile
public final class VirtualFile
A virtual file. This is a symbolic reference to a location in the virtual file system hierarchy. Holding a VirtualFile
instance gives no guarantees as to the presence or immutability of the referenced file or any of its
parent path elements.
Method Summary | |
---|---|
URI |
asDirectoryURI()
Get file's URI as a directory. |
URL |
asDirectoryURL()
Get file's URL as a directory. |
URI |
asFileURI()
Get file's URI as a file. |
URL |
asFileURL()
Get file's URL as a file. |
boolean |
delete()
Delete this virtual file |
boolean |
equals(Object o)
Determine whether the given object is equal to this one. |
boolean |
equals(VirtualFile o)
Determine whether the given object is equal to this one. |
boolean |
exists()
Tests whether the underlying implementation file still exists. |
Certificate[] |
getCertificates()
Get the Certificate s for the virtual file. |
VirtualFile |
getChild(String path)
Get a child virtual file. |
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 |
CodeSigner[] |
getCodeSigners()
Get the CodeSigner s for a the virtual file. |
long |
getLastModified()
When the file was last modified |
String |
getLowerCaseName()
Deprecated. should not be used anymore, as the code is case-sensitive from JBVFS-170 |
String |
getName()
Get the simple VF name (X.java) |
VirtualFile |
getParent()
Get a VirtualFile which represents the parent of this instance. |
List<VirtualFile> |
getParentFileList()
Get the all the parent files of this virtual file from this file to the root as a list. |
VirtualFile[] |
getParentFiles()
Get the all the parent files of this virtual file from this file to the root. |
String |
getPathName()
Get the absolute VFS full path name (/xxx/yyy/foo.ear/baz.jar/org/jboss/X.java) |
String |
getPathNameRelativeTo(VirtualFile parent)
Get the path name relative to a parent virtual file. |
File |
getPhysicalFile()
Get a physical file for this virtual file. |
long |
getSize()
Get the size |
int |
hashCode()
Get a hashcode for this virtual file. |
boolean |
isDirectory()
Determine whether the named virtual file is a directory. |
boolean |
isFile()
Determine whether the named virtual file is a plain file. |
boolean |
isLeaf()
Deprecated. use isDirectory() or isFile() instead |
boolean |
isRoot()
Determines whether this virtual file represents a true root of a file system. |
InputStream |
openStream()
Access the file contents. |
String |
toString()
Get a human-readable (but non-canonical) representation of this virtual file. |
URI |
toURI()
Get file's current URI. |
URL |
toURL()
Get file's current URL. |
void |
visit(VirtualFileVisitor visitor)
Visit the virtual file system |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public String getName()
public String getLowerCaseName()
public String getPathName()
public String getPathNameRelativeTo(VirtualFile parent) throws IllegalArgumentException
IllegalArgumentException
is thrown.
parent
- the parent virtual file
IllegalArgumentException
- if the given virtual file is not a parent of this virtual filepublic long getLastModified()
public long getSize()
public boolean exists()
public boolean isRoot()
true
if this represents a root.@Deprecated public boolean isLeaf()
isDirectory()
or isFile()
instead
true
if a simple filepublic boolean isFile()
true
if it is a plain file, false
otherwisepublic boolean isDirectory()
true
if it is a directory, false
otherwisepublic InputStream openStream() throws IOException
IOException
- for any error accessing the file systempublic boolean delete()
true
if file was deletedpublic File getPhysicalFile() throws IOException
IOException
- if an I/O error occurs while producing the physical filepublic VirtualFile getParent()
VirtualFile
which represents the parent of this instance.
null
if there is no parentpublic VirtualFile[] getParentFiles()
public List<VirtualFile> getParentFileList()
public List<VirtualFile> getChildren()
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 nodepublic List<VirtualFile> getChildrenRecursively() throws IOException
This always uses
VisitorAttributes.RECURSE
IOException
- for any problem accessing the virtual file system
IllegalStateException
- if the file is closedpublic 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 nodepublic 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 closedpublic VirtualFile getChild(String path)
path
- the path
IllegalArgumentException
- if the path is nullpublic URL toURL() throws MalformedURLException
MalformedURLException
- if the URL is somehow malformedasDirectoryURL()
,
asFileURL()
public URI toURI() throws URISyntaxException
URISyntaxException
- if the URI is somehow malformedasDirectoryURI()
,
asFileURI()
public URL asDirectoryURL() throws MalformedURLException
"/"
character.
MalformedURLException
- if the URL is somehow malformedpublic URI asDirectoryURI() throws URISyntaxException
"/"
character.
URISyntaxException
- if the URI is somehow malformedpublic URL asFileURL() throws MalformedURLException
"/"
character unless this VirtualFile
represents a root.
MalformedURLException
- if the URL is somehow malformedpublic URI asFileURI() throws URISyntaxException
"/"
character unless this VirtualFile
represents a root.
URISyntaxException
- if the URI is somehow malformedpublic CodeSigner[] getCodeSigners()
CodeSigner
s for a the virtual file.
CodeSigner
s for the virtual file, or null
if not signedpublic Certificate[] getCertificates()
Certificate
s for the virtual file. Simply extracts the certificate entries from
the code signers array.
null
if not signedpublic String toString()
toString
in class Object
public boolean equals(Object o)
VirtualFile
from the same VFS
instance with the same name.
equals
in class Object
o
- the other object
true
if they are equalpublic boolean equals(VirtualFile o)
VirtualFile
from the same VFS
instance with the same name.
o
- the other virtual file
true
if they are equalpublic int hashCode()
hashCode
in class Object
|
JBoss VFS 3.1.0.Final-redhat-2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |