Skip navigation links
com.caucho.vfs

Class Vfs

    • Method Detail

      • lookup

        public static Path lookup(java.lang.String url)
        Returns a new path relative to the current directory.
        Parameters:
        url - a relative or absolute url
        Returns:
        the new path.
      • getPwd

        public static Path getPwd()
        Returns a path for the current directory.
      • getLocalScheme

        public static SchemeMap getLocalScheme()
      • getDefaultScheme

        public static SchemeMap getDefaultScheme()
      • getPwd

        public static Path getPwd(java.lang.ClassLoader loader)
        Returns a path for the current directory.
      • setPwd

        public static void setPwd(Path pwd)
        Sets a path for the current directory in the current environment.
      • setPwd

        public static void setPwd(Path pwd,
                                  java.lang.ClassLoader loader)
        Sets a path for the current directory in the current environment.
      • lookup

        public static Path lookup()
        Returns a path for the current directory.
      • lookup

        public static Path lookup(java.lang.String url,
                                  java.util.Map<java.lang.String,java.lang.Object> attr)
        Returns a new path, including attributes.

        For example, an application may want to set locale headers for an HTTP request.

        Parameters:
        url - the relative url
        attr - attributes used in searching for the url
      • lookupNative

        public static Path lookupNative(java.lang.String url)
        Returns a path using the native filesystem conventions.

        For example, on windows

         Path path = Vfs.lookup("d:\\temp\\test.html");
         
        Parameters:
        url - a relative path using the native filesystem conventions.
      • lookup

        public static Path lookup(java.net.URL url)
        Looks up a URL, decoding '%'
        Parameters:
        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)
        Returns a native filesystem path with attributes.
        Parameters:
        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)
        Creates new ReadStream from an InputStream
      • openRead

        public static ReadStream openRead(java.io.Reader reader)
        Creates a ReadStream from a Reader
      • openRead

        public static ReadStream openRead(java.lang.String path)
                                   throws java.io.IOException
        Create a ReadStream from a string. utf-8 is used as the encoding
        Throws:
        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)
        Creates a write stream to a CharBuffer. This is the standard way to write to a string.
      • openWrite

        public static WriteStream openWrite(java.lang.String path)
                                     throws java.io.IOException
        Throws:
        java.io.IOException
      • openAppend

        public static WriteStream openAppend(java.lang.String path)
                                      throws java.io.IOException
        Throws:
        java.io.IOException
      • decode

        public static java.lang.String decode(java.lang.String uri)
      • initJNI

        public static void initJNI()
        Initialize the JNI.