Overview | Package | Class | Tree | Deprecated | Index | Help
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES

## Package com.caucho.vfs

Resin's Virtual File System.

See:
Description

Interface Summary
EnclosedWriteStream |
VfsWriteObject |

Class Summary
BufferedReaderAdapter | Trivial adapter so readers and input streams can be used in the same servlet.
ByteToChar | Utility class for converting a byte stream to a character stream.
CachePath | A cache wrapper over a path.
ClassLoaderStream | A stream that varies depending on the context class loader.
ContextStream | A stream that varies depending on the context class loader.
Depend | Class for keeping track of modifications.
Encoding | Converts between the mime encoding names and Java encoding names.
FilePath | FilePath implements the native filesystem.
FileReadStream | Stream encapsulating FileInputStream
FilesystemPath | Abstract FilesystemPath, the parent of hierarchical Paths like FilePath or HttpPath.
HttpPath | The HTTP scheme.
JarPath | A filesystem for .jar files.
JndiPath | Adapts the JNDI to the Path API.
LogStream | The primary debugging stream in Resin.
MailtoPath | The mailto: scheme sends mail using the SMTP protocol.
MemoryPath |
MemoryStream |
MergePath | A merging of several Paths used like a CLASSPATH.
MultipartStream |
NullPath |
OldByteToChar | Utility class for converting a byte stream to a character stream.
Path | A virtual filesystem path, essentially represented by a URL.
PipeStream | Stream allowing two threads to read and write to each other.
Pwd | Deprecated: use the Vfs facade instead.
ReaderWriterStream |
ReadStream | A fast bufferered input stream supporting both character and byte data.
ReadWritePair |
RotateStream | Automatically-rotating streams.
SchemeMap | The top-level filesystem schemes are collected into a single map.
SocketStream | Specialized stream to handle sockets.
StderrStream | Stream encapsulating System.err.
StdoutStream | Stream encapsulating System.out.
StreamFilter |
StreamImpl | This is the service provider's interface for a stream supported by the VFS.
StringStream |
StringWriter |
TcpPath | Implements a tcp stream, essentially just a socket pair.
TempBuffer |
TempReadStream |
TempStream |
TimestampFilter | Automatically-rotating streams.
Vfs | Facade to create useful Path and Stream objects.
VfsStream | Stream encapsulating InputStream/OutputStream.
WriteStream | A fast bufferered output stream supporting both character and byte data.

Exception Summary
ClientDisconnectException | Exception thrown when a client unexpectedly closes a connection.
IOExceptionWrapper |

## Package com.caucho.vfs Description

Resin's Virtual File System. Resin's VFS combines and simplifies the morass in Java I/O. The core classes are:

- `Path` -- API similar to File, but supports URLs as well as paths.
- `ReadStream` -- buffered read stream handing both byte and character input
- `WriteStream` -- buffered write stream handling both byte and character output

### Virtual Paths

Path access is based on standard URLs. The following URL schemes are predefined.

- file: -- the standard filesystem
- http: -- the http filesystem
- mailto: -- sending mail
- stdout: -- standard output (System.out)
- stderr: -- standard error (System.err)
- tcp: -- TCP socket pair
- null: -- /dev/null
- log: -- debug logging (controlled by resin.conf)

### Reading a File

`ReadStream` implements `InputStream` so it can be used wherever an `InputStream` is appropriate.

The `Vfs` facade is convenient for opening files. ``

    ReadStream rs = Vfs.openRead("http://www.yahoo.com");
    int ch;

    while ((ch = rs.read()) >= 0)
      System.out.print((char) ch);

### Writing a File

`WriteStream` implements `OutputStream` so it can be used wherever an `OutputStream` is appropriate. It also implements the familiar `print()` methods from `PrintStream`, although they do throw IOExceptions.

The `Vfs` facade is convenient for opening files. ``

    WriteStream ws = Vfs.openWrite("mailto:user@foo.com");
    ws.setAttribute("subject", "hi, there");

    ws.println("Just a little hello, world message");
    ws.close();

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES