org.erowid.sperosearch.splitindex
Class SplitIndexDirectory

java.lang.Object
  extended byorg.apache.lucene.store.Directory
      extended byorg.erowid.sperosearch.splitindex.SplitIndexDirectory

public class SplitIndexDirectory
extends Directory

A read-only Directory for use with Lucene. It uses standard HTTP to retrieve the files, which are split into segments and then compressed. In addition, there is a directory file that lists the files, their sizes, the segment size, and other information.

Version:
: $Header: /cvsroot/sperowider/SPEROWIDER_MODULE/javasource/org/erowid/sperosearch/splitindex/SplitIndexDirectory.java,v 1.1 2005/06/02 06:07:58 gurustu Exp $
Author:
: $Author: gurustu $

Method Summary
 void close()
          Closes this directory and cleans up resources.
 OutputStream createFile(String fileName)
          Does nothing, because this is a read only directory.
 void deleteFile(String arg0)
          Does nothing, because this is a read only directory.
 boolean fileExists(String fileName)
          Returns true if the requested file exists in this directory.
 long fileLength(String fileName)
          Returns the length of the named file.
 long fileModified(String fileName)
          Always returns 0, because this is a read only directory.
static SplitIndexDirectory getDirectory(URL url)
          A factory for creating/returning an HttpDirectory for the passed in URL.
 String[] list()
          Http can't really support this.
 Lock makeLock(String arg0)
          Returns a dummy lock object.
 InputStream openFile(String fileName)
          Returns a InputStream that pipes in the data for the requested file.
 void renameFile(String arg0, String arg1)
          Does nothing, because this is a read only directory.
 void touchFile(String arg0)
          Does nothing, because this is a read only directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDirectory

public static SplitIndexDirectory getDirectory(URL url)
                                        throws IOException
A factory for creating/returning an HttpDirectory for the passed in URL. If the passed in URL had never been requested before, it creates a new HttpDirectory. Otherwise it returns an earlier instantiated object.

Throws:
IOException

list

public String[] list()
              throws IOException
Http can't really support this. Hopefully it isn't important.

Throws:
IOException

fileExists

public boolean fileExists(String fileName)
                   throws IOException
Returns true if the requested file exists in this directory.

Throws:
IOException

fileModified

public long fileModified(String fileName)
                  throws IOException
Always returns 0, because this is a read only directory.

Throws:
IOException

touchFile

public void touchFile(String arg0)
               throws IOException
Does nothing, because this is a read only directory.

Throws:
IOException

deleteFile

public void deleteFile(String arg0)
                throws IOException
Does nothing, because this is a read only directory.

Throws:
IOException

renameFile

public void renameFile(String arg0,
                       String arg1)
                throws IOException
Does nothing, because this is a read only directory.

Throws:
IOException

fileLength

public long fileLength(String fileName)
                throws IOException
Returns the length of the named file.

Throws:
IOException

createFile

public OutputStream createFile(String fileName)
                        throws IOException
Does nothing, because this is a read only directory.

Throws:
IOException

openFile

public InputStream openFile(String fileName)
                     throws IOException
Returns a InputStream that pipes in the data for the requested file.

Throws:
IOException

makeLock

public Lock makeLock(String arg0)
Returns a dummy lock object.


close

public void close()
           throws IOException
Closes this directory and cleans up resources.

Throws:
IOException

spero logo small Sperowider is
© 2005 Erowid.org