public final class Vfs
extends java.lang.Object
Path path = Vfs.lookup("foo.html");
The default scheme is the file scheme. Other schemes are
available using the full url.
Path mail = Vfs.lookup("mailto:drofnats@foo.com.test?subject='hi'");
Stream body = mail.openWrite();
body.writeln("How's it going?");
body.close();
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
decode(java.lang.String uri) |
static SchemeMap |
getDefaultScheme() |
static FilesystemPath |
getGlobalPwd() |
static SchemeMap |
getLocalScheme() |
static Path |
getPwd()
Returns a path for the current directory.
|
static Path |
getPwd(java.lang.ClassLoader loader)
Returns a path for the current directory.
|
static void |
initJNI()
Initialize the JNI.
|
static Path |
lookup()
Returns a path for the current directory.
|
static Path |
lookup(java.lang.String url)
Returns a new path relative to the current directory.
|
static Path |
lookup(java.lang.String url,
java.util.Map<java.lang.String,java.lang.Object> attr)
Returns a new path, including attributes.
|
static Path |
lookup(java.net.URL url)
Looks up a URL, decoding '%'
|
static Path |
lookupNative(java.lang.String url)
Returns a path using the native filesystem conventions.
|
static Path |
lookupNative(java.lang.String url,
java.util.Map<java.lang.String,java.lang.Object> attr)
Returns a native filesystem path with attributes.
|
static WriteStream |
openAppend(java.lang.String path) |
static ReadStream |
openRead(java.io.InputStream is)
Creates new ReadStream from an InputStream
|
static ReadStream |
openRead(java.io.InputStream is,
WriteStream ws) |
static ReadStream |
openRead(java.io.Reader reader)
Creates a ReadStream from a Reader
|
static ReadStream |
openRead(java.lang.String path)
Create a ReadStream from a string.
|
static ReadWritePair |
openReadWrite(java.io.InputStream is,
java.io.OutputStream os) |
static ReadStream |
openString(java.lang.String string) |
static WriteStream |
openWrite(CharBuffer cb)
Creates a write stream to a CharBuffer.
|
static WriteStream |
openWrite(java.io.OutputStream os) |
static WriteStream |
openWrite(java.lang.String path) |
static WriteStream |
openWrite(java.io.Writer writer) |
static void |
setPwd(Path pwd)
Sets a path for the current directory in the current environment.
|
static void |
setPwd(Path pwd,
java.lang.ClassLoader loader)
Sets a path for the current directory in the current environment.
|
public static Path lookup(java.lang.String url)
url
- a relative or absolute urlpublic static FilesystemPath getGlobalPwd()
public static Path getPwd()
public static SchemeMap getLocalScheme()
public static SchemeMap getDefaultScheme()
public static Path getPwd(java.lang.ClassLoader loader)
public static void setPwd(Path pwd)
public static void setPwd(Path pwd, java.lang.ClassLoader loader)
public static Path lookup()
public static Path lookup(java.lang.String url, java.util.Map<java.lang.String,java.lang.Object> attr)
For example, an application may want to set locale headers for an HTTP request.
url
- the relative urlattr
- attributes used in searching for the urlpublic static Path lookupNative(java.lang.String url)
For example, on windows
Path path = Vfs.lookup("d:\\temp\\test.html");
url
- a relative path using the native filesystem conventions.public static Path lookup(java.net.URL url)
url
- a relative path using the native filesystem conventions.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 urlpublic static ReadWritePair openReadWrite(java.io.InputStream is, java.io.OutputStream os)
public static ReadStream openRead(java.io.InputStream is)
public static ReadStream openRead(java.io.InputStream is, WriteStream ws)
public static ReadStream openRead(java.io.Reader reader)
public static ReadStream openRead(java.lang.String path) throws java.io.IOException
java.io.IOException
public static ReadStream openString(java.lang.String string)
public static WriteStream openWrite(java.io.OutputStream os)
public static WriteStream openWrite(java.io.Writer writer)
public static WriteStream openWrite(CharBuffer cb)
public static WriteStream openWrite(java.lang.String path) throws java.io.IOException
java.io.IOException
public static WriteStream openAppend(java.lang.String path) throws java.io.IOException
java.io.IOException
public static java.lang.String decode(java.lang.String uri)
public static void initJNI()