public interface VfsNode
This interface encapsulates the behavior common to both VfsFile and VfsDirectory. Many of the search and listing features may return both types, so we need a common supertype to capture that as well.
Copyright 2004-2007 Partner Software, Inc.
| Modifier and Type | Method and Description |
|---|---|
boolean |
exists()
Whether the Vfs node exists.
|
Path |
getAbsolutePath()
The absolute path to the Vfs node.
|
java.lang.String |
getBaseName()
Base name of node; this is the part before the '.' if there's a file
extension.
|
VfsDirectory |
getDirectory()
The VfsDirectory this node is in, or null if it is the root directory.
|
java.lang.String |
getExtension()
File extension (the part after the '.' in most file names; includes the
'.').
|
DateAndTime |
getLastModified()
Returns the date and time the node was last modified.
|
long |
getLastModifiedMillis()
Returns the timestamp in milliseconds that the node was last modified.
|
java.lang.String |
getName()
Bare name of node.
|
Path |
getPath()
The path to the Vfs node.
|
java.net.URI |
getUri()
URI for this VfsNode.
|
java.net.URL |
getUrl()
URL for this VfsNode.
|
Vfs |
getVfs()
The Vfs this node is in.
|
boolean |
isBackup()
True if the file is a backup file - commonly this is based on file name patterns like *~ or *.bak.
|
boolean |
isHidden()
True if the file is a hidden file - commonly this is based on the file name starting with a ".".
|
void |
make()
Creates the node and any ancestor directories needed to contain it.
|
void |
setLastModified(DateAndTime newLast)
If possible, sets the date and time the node was last modified.
|
void |
setLastModifiedMillis(long millis)
If possible, sets the date and time the node was last modified in
milliseconds.
|
java.io.File |
toFile()
java.io.File for this VfsNode.
|
boolean exists()
throws java.io.IOException
make() to create the node if it does not exist.java.io.IOException - if it can't tell for some reason.void make()
throws java.io.IOException
java.io.IOException - if it can't.Path getPath()
Path getAbsolutePath()
Vfs getVfs()
VfsDirectory getDirectory()
java.lang.String getName()
java.lang.String getBaseName()
java.lang.String getExtension()
java.net.URL getUrl()
java.net.URI getUri()
java.io.File toFile()
boolean isBackup()
boolean isHidden()
DateAndTime getLastModified() throws java.io.IOException
new DateAndTime(getLastModifiedMillis()).java.io.IOExceptionvoid setLastModified(DateAndTime newLast) throws java.io.IOException
setLastModifiedMillis(newLast.getMillis()).java.io.IOExceptionlong getLastModifiedMillis()
throws java.io.IOException
getLastModified().getMillis().
If this capability is unsupported by the VFS implementation, returns 0.
java.io.IOExceptionvoid setLastModifiedMillis(long millis)
throws java.io.IOException
setLastModified(new DateAndTime(millis)).
If this capability is unsupported by the VFS implementation, does nothing.
java.io.IOException