Skip navigation links

Package com.caucho.vfs

Resin's Virtual File System.

See: Description

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:

Virtual Paths

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

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();
Skip navigation links