public interface Vfs
Vfs serves three major purposes.
First, it embodies the concept of a hierarchical filesystem, rather than just
a file or directory. File, while sufficient for most
purposes, is primarily designed to represent a single file, and doing
multiple file operations with it (recursive deletes or copies, directory
searches, etc.) is very clumsy. A Vfs represents a filesystem as a whole.
Second, Vfs provides an abstraction from standard disk-based filesystems, allowing alternate storage implementations. VFSModules can be written which allow you to treat a website, FTP site, zipfile, database, or other data source as a hierarchical filesystem, without changing the code required by Vfs clients to examine and manipulate it.
Third, Vfs provides a wealth of convenience methods for examining and
manipulating a filesystem. These are written in the spirit of UNIX tools such
as cp, rm, and find. Recursively finding, copying, and deleting files are
essential to serious file management, and File has no
equivalents to these.
Copyright 2004-2007 Partner Software, Inc.
| Modifier and Type | Method and Description |
|---|---|
VfsDirectory |
directoryFor(Path path)
Returns a VfsDirectory for the given path.
|
VfsDirectory |
directoryFor(java.lang.String pathString)
Returns a VfsDirectory for the given path.
|
VfsFile |
fileFor(Path path)
Returns a VfsFile for the given path.
|
VfsFile |
fileFor(java.lang.String pathString)
Returns a VfsFile for the given path string.
|
Path |
getAbsolutePath()
Absolute path to the root of this Vfs.
|
int |
getBufferSize()
Returns the current buffer size for copies and other transfers.
|
boolean |
getDisableOptimizations()
If true, this VFS uses only pure Java methods and avoids platform-specific optimizations (e.g.
|
boolean |
getVerifyTransfers()
If true, this VFS uses checksums or similar mechanism to verify copies and other data transfers.
|
boolean |
isWritable()
True if this module supports writing.
|
void |
setBufferSize(int newSize)
Sets the current buffer size for copies and other transfers.
|
void |
setDisableOptimizations(boolean tizit) |
void |
setVerifyTransfers(boolean shouldI) |
Path getAbsolutePath()
boolean isWritable()
VfsFile fileFor(Path path)
path - to fileVfsDirectory directoryFor(Path path)
path - to directoryVfsFile fileFor(java.lang.String pathString)
pathString - string-encoded path to fileVfsDirectory directoryFor(java.lang.String pathString)
pathString - string-encoded path to directoryint getBufferSize()
void setBufferSize(int newSize)
boolean getVerifyTransfers()
void setVerifyTransfers(boolean shouldI)
boolean getDisableOptimizations()
void setDisableOptimizations(boolean tizit)