|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.caucho.vfs.Vfs
public final class Vfs
Facade to create useful Path and Stream objects.
The default scheme is the file scheme. Other schemes are
available using the full url.
For example, an application may want to set locale headers
for an HTTP request.
For example, on windows
Path path = Vfs.lookup("foo.html");
Path mail = Vfs.lookup("mailto:drofnats@foo.com.test?subject='hi'");
Stream body = mail.openWrite();
body.writeln("How's it going?");
body.close();
Method Summary
static java.lang.Stringdecode(java.lang.String uri)
static SchemeMapgetDefaultScheme()
static FilesystemPathgetGlobalPwd()
static SchemeMapgetLocalScheme()
static PathgetPwd()
Returns a path for the current directory.
static PathgetPwd(java.lang.ClassLoader loader)
Returns a path for the current directory.
static voidinitJNI()
Initialize the JNI.
static Pathlookup()
Returns a path for the current directory.
static Pathlookup(java.lang.String url)
Returns a new path relative to the current directory.
static Pathlookup(java.lang.String url,
java.util.Map<java.lang.String,java.lang.Object> attr)
Returns a new path, including attributes.
static Pathlookup(java.net.URL url)
Looks up a URL, decoding '%'
static PathlookupNative(java.lang.String url)
Returns a path using the native filesystem conventions.
static PathlookupNative(java.lang.String url,
java.util.Map<java.lang.String,java.lang.Object> attr)
Returns a native filesystem path with attributes.
static WriteStreamopenAppend(java.lang.String path)
static ReadStreamopenRead(java.io.InputStream is)
Creates new ReadStream from an InputStream
static ReadStreamopenRead(java.io.InputStream is,
WriteStream ws)
static ReadStreamopenRead(java.io.Reader reader)
Creates a ReadStream from a Reader
static ReadStreamopenRead(java.lang.String path)
Create a ReadStream from a string.
static ReadWritePairopenReadWrite(java.io.InputStream is,
java.io.OutputStream os)
static ReadStreamopenString(java.lang.String string)
static WriteStreamopenWrite(CharBuffer cb)
Creates a write stream to a CharBuffer.
static WriteStreamopenWrite(java.io.OutputStream os)
static WriteStreamopenWrite(java.lang.String path)
static WriteStreamopenWrite(java.io.Writer writer)
static voidsetPwd(Path pwd)
Sets a path for the current directory in the current environment.
static voidsetPwd(Path pwd,
java.lang.ClassLoader loader)
Sets a path for the current directory in the current environment.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Method Detail
lookup
public static Path lookup(java.lang.String url)
url - a relative or absolute url
getGlobalPwd
public static FilesystemPath getGlobalPwd()
getPwd
public static Path getPwd()
getLocalScheme
public static SchemeMap getLocalScheme()
getDefaultScheme
public static SchemeMap getDefaultScheme()
getPwd
public static Path getPwd(java.lang.ClassLoader loader)
setPwd
public static void setPwd(Path pwd)
setPwd
public static void setPwd(Path pwd,
java.lang.ClassLoader loader)
lookup
public static Path lookup()
lookup
public static Path lookup(java.lang.String url,
java.util.Map<java.lang.String,java.lang.Object> attr)
url - the relative urlattr - attributes used in searching for the url
lookupNative
public static Path lookupNative(java.lang.String url)
Path path = Vfs.lookup("d:\\temp\\test.html");
url - a relative path using the native filesystem conventions.
lookup
public static Path lookup(java.net.URL url)
url - a relative path using the native filesystem conventions.
lookupNative
public static Path lookupNative(java.lang.String url,
java.util.Map<java.lang.String,java.lang.Object> attr)
url - a relative path using the native filesystem conventions.attr - attributes used in searching for the url
openReadWrite
public static ReadWritePair openReadWrite(java.io.InputStream is,
java.io.OutputStream os)
openRead
public static ReadStream openRead(java.io.InputStream is)
openRead
public static ReadStream openRead(java.io.InputStream is,
WriteStream ws)
openRead
public static ReadStream openRead(java.io.Reader reader)
openRead
public static ReadStream openRead(java.lang.String path)
throws java.io.IOException
java.io.IOException
openString
public static ReadStream openString(java.lang.String string)
openWrite
public static WriteStream openWrite(java.io.OutputStream os)
openWrite
public static WriteStream openWrite(java.io.Writer writer)
openWrite
public static WriteStream openWrite(CharBuffer cb)
openWrite
public static WriteStream openWrite(java.lang.String path)
throws java.io.IOException
java.io.IOException
openAppend
public static WriteStream openAppend(java.lang.String path)
throws java.io.IOException
java.io.IOException
decode
public static java.lang.String decode(java.lang.String uri)
initJNI
public static void initJNI()
Overview
Package
Class
Use
Tree
Deprecated
Index
Help
PREV CLASS
NEXT CLASS
FRAMES
NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD