<s1 title="VFS Introduction">

<p>Resin's VFS combines and simplifies the morass
in Java I/O.  The core classes are:</p>
<ul>
<li><var/Path/> - API similar to File, but supports URLs as well as
paths.
<li><var/ReadStream/> - buffered read stream handing both
byte and character input
<li><var/WriteStream/> - buffered write stream handling both
byte and character output
</ul>

<s2 title="Virtual Paths">

<p>Path access is based on standard URLs.  The following URL schemes are
predefined.
<ul>
<li><b>file:</b> -- the standard filesystem
<li><b>http:</b> -- the http filesystem
<li><b>mailto:</b> -- sending mail
<li><b>stdout:</b> -- standard output (System.out)
<li><b>stderr:</b> -- standard error (System.err)
<li><b>tcp:</b> -- TCP socket pair
<li><b>null:</b> -- /dev/null
<li><b>log:</b> -- debug logging (controlled by resin.conf)
</ul>

</s2>

<s2 title="ReadStream and WriteStream">

<p>Since <var/ReadStream/> implements <var/InputStream/> and
<var/WriteStream/> implements <var/OutputStream/> the VFS streams can
be used without fuss in most cases.</p>

<p>The VFS streams are always buffered, so applications don't need to
worry about creating buffered streams.</p>

<p>WriteStream also implements the <var/print()/> functions, throwing
IOExceptions, so applications can easily write strings.</p>

</s2>

<s2 title="Vfs Facade">

<p>The <var/Vfs/> facade is the most convenient way to open a new file using
Resin's VFS.  To open a file for reading, use</p>

<example>
ReadStream is = Vfs.openRead("test.html");
</example>

</s2>
</s1>
