org.vrspace.vfs
Class FileManager

java.lang.Object
  extended byorg.vrspace.vfs.FileManager

public class FileManager
extends java.lang.Object


Field Summary
protected  DB db
           
 java.lang.String docBase
           
protected  Cache filez
          this needs to be memory-sensitive cache (org.vrspace.util.Cache)
protected  Server server
           
 
Constructor Summary
FileManager(Server server, DB db)
           
 
Method Summary
 boolean contains(Location loc)
           
 boolean contains(java.lang.String url)
           
 java.io.File getFile(Location loc)
           
 java.net.URL getLocalCopy(Location loc)
          Return URL of local document copy.
 java.net.URL getLocalURL(Location loc)
           
 java.net.URL getLocalURL(java.lang.String url)
           
 Location getLocation(java.lang.String url)
           
 void store(Location loc)
           
 void store(Location loc, java.io.InputStream in)
           
 void store(java.lang.String url)
          Fetch remote file and store it to local repository
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

server

protected Server server

db

protected DB db

docBase

public java.lang.String docBase

filez

protected Cache filez
this needs to be memory-sensitive cache (org.vrspace.util.Cache)

Constructor Detail

FileManager

public FileManager(Server server,
                   DB db)
Method Detail

contains

public boolean contains(java.lang.String url)
                 throws java.net.MalformedURLException
Throws:
java.net.MalformedURLException

contains

public boolean contains(Location loc)
                 throws java.net.MalformedURLException
Throws:
java.net.MalformedURLException

getLocalCopy

public java.net.URL getLocalCopy(Location loc)
                          throws java.lang.Exception
Return URL of local document copy. If no copy is available tries to fetch one.

Throws:
java.lang.Exception

getLocalURL

public java.net.URL getLocalURL(java.lang.String url)
                         throws java.net.MalformedURLException
Throws:
java.net.MalformedURLException

getLocalURL

public java.net.URL getLocalURL(Location loc)
                         throws java.net.MalformedURLException
Throws:
java.net.MalformedURLException

getFile

public java.io.File getFile(Location loc)

store

public void store(java.lang.String url)
           throws java.lang.Exception
Fetch remote file and store it to local repository

Throws:
java.lang.Exception

store

public void store(Location loc)
           throws java.io.IOException,
                  java.io.FileNotFoundException
Throws:
java.io.IOException
java.io.FileNotFoundException

store

public void store(Location loc,
                  java.io.InputStream in)
           throws java.io.IOException,
                  java.io.FileNotFoundException
Throws:
java.io.IOException
java.io.FileNotFoundException

getLocation

public Location getLocation(java.lang.String url)
                     throws java.net.MalformedURLException
Throws:
java.net.MalformedURLException