com.partnersoft.io.net
Class URLVFSModule

java.lang.Object
  extended by com.partnersoft.io.net.URLVFSModule
All Implemented Interfaces:
VFSModule

public class URLVFSModule
extends java.lang.Object
implements VFSModule

A VFS implementation based on generic URL functionality.

Author:
Paul Reavis Copyright 2004 Partner Software, Inc.

Constructor Summary
URLVFSModule(java.net.URL root)
           
URLVFSModule(java.net.URL root, java.lang.String systemPath)
           
 
Method Summary
 boolean exists(java.lang.String path)
          True if the file exists.
 java.io.InputStream inputStreamFor(java.lang.String path)
          This is weird - we want an unprocessed copy of the file, not processed, so we have to run around to prevent e.g.
 boolean isDirectory(java.lang.String path)
          True if the path is a directory.
 boolean isWritable()
          True if this module supports writing.
 long lastModified(java.lang.String path)
          This is currently a nonfunctional stub that always returns zero.
 VFSNode[] list(java.lang.String path)
          Lists the entries in the virtual directory at path.
 java.io.OutputStream outputStreamFor(java.lang.String path)
          Returns on output stream for the given path.
 VFSRandomAccess randomAccessFor(java.lang.String path)
          Returns a random-access handle for the given path.
 void remove(java.lang.String path)
          Removes the file at the given path.
 int sizeOf(java.lang.String path)
          Returns the file size for the given path.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

URLVFSModule

public URLVFSModule(java.net.URL root,
                    java.lang.String systemPath)

URLVFSModule

public URLVFSModule(java.net.URL root)
Method Detail

isWritable

public boolean isWritable()
Description copied from interface: VFSModule
True if this module supports writing.

Specified by:
isWritable in interface VFSModule

inputStreamFor

public java.io.InputStream inputStreamFor(java.lang.String path)
                                   throws java.io.IOException
This is weird - we want an unprocessed copy of the file, not processed, so we have to run around to prevent e.g. php from processing the source file.

Specified by:
inputStreamFor in interface VFSModule
Throws:
java.io.IOException

outputStreamFor

public java.io.OutputStream outputStreamFor(java.lang.String path)
                                     throws java.io.IOException
Description copied from interface: VFSModule
Returns on output stream for the given path. Throws UnsupportedOperationException if isWritable() is false.

Specified by:
outputStreamFor in interface VFSModule
Throws:
java.io.IOException

randomAccessFor

public VFSRandomAccess randomAccessFor(java.lang.String path)
                                throws java.io.IOException
Description copied from interface: VFSModule
Returns a random-access handle for the given path.

Specified by:
randomAccessFor in interface VFSModule
Throws:
java.io.IOException

exists

public boolean exists(java.lang.String path)
               throws java.io.IOException
Description copied from interface: VFSModule
True if the file exists.

Specified by:
exists in interface VFSModule
Throws:
java.io.IOException

isDirectory

public boolean isDirectory(java.lang.String path)
                    throws java.io.IOException
Description copied from interface: VFSModule
True if the path is a directory.

Specified by:
isDirectory in interface VFSModule
Throws:
java.io.IOException

sizeOf

public int sizeOf(java.lang.String path)
           throws java.io.IOException
Description copied from interface: VFSModule
Returns the file size for the given path.

Specified by:
sizeOf in interface VFSModule
Throws:
java.io.IOException

remove

public void remove(java.lang.String path)
            throws java.io.IOException
Description copied from interface: VFSModule
Removes the file at the given path.

Specified by:
remove in interface VFSModule
Throws:
java.io.IOException

list

public VFSNode[] list(java.lang.String path)
               throws java.io.IOException
Description copied from interface: VFSModule
Lists the entries in the virtual directory at path.

Specified by:
list in interface VFSModule
Throws:
java.io.IOException

lastModified

public long lastModified(java.lang.String path)
This is currently a nonfunctional stub that always returns zero. Beware.

Specified by:
lastModified in interface VFSModule

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object