net.sf.gumshoe.indexer
Class ContentReader

java.lang.Object
  extended by net.sf.gumshoe.indexer.ContentReader
Direct Known Subclasses:
DefaultContentReader, OOOContentReader, OSContentReader, XMLContentReader

public abstract class ContentReader
extends java.lang.Object

Author:
Gabor TODO To change the template for this generated type comment go to Window - Preferences - Java - Code Style - Code Templates

Field Summary
static java.lang.String CONTENTS
           
static java.lang.String FILECATEGORY
           
static java.lang.String FILENAME
           
static java.lang.String MODIFIED
           
 
Constructor Summary
ContentReader()
           
 
Method Summary
protected  void addDefaultFields(java.io.File f, org.apache.lucene.document.Document doc, java.lang.String category)
          Convenience method, adds default fields to index entry
abstract  java.lang.String getCategory()
          Category for this reader.
protected  java.io.Reader getContentFromXML(java.io.Reader input)
          Convenience method to process XML content
abstract  org.apache.lucene.document.Document getDocument(java.io.File f)
          Generate index entry for file
abstract  java.util.List getSupportedExtensions()
          List extensions supported by this reader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MODIFIED

public static final java.lang.String MODIFIED
See Also:
Constant Field Values

FILENAME

public static final java.lang.String FILENAME
See Also:
Constant Field Values

FILECATEGORY

public static final java.lang.String FILECATEGORY
See Also:
Constant Field Values

CONTENTS

public static final java.lang.String CONTENTS
See Also:
Constant Field Values
Constructor Detail

ContentReader

public ContentReader()
Method Detail

getDocument

public abstract org.apache.lucene.document.Document getDocument(java.io.File f)
                                                         throws java.lang.Exception
Generate index entry for file

Parameters:
f - file to be indexed
Returns:
index entry
Throws:
java.lang.Exception

getSupportedExtensions

public abstract java.util.List getSupportedExtensions()
List extensions supported by this reader

Returns:
list of extensions

getCategory

public abstract java.lang.String getCategory()
Category for this reader. Currently all readers return empty string. Later this will allow developing a "type" based interface with special search fields for various categories, e.g. an email would have a from, to, cc, subject, etc. fields.

Returns:
category (like email, document, etc.)

addDefaultFields

protected void addDefaultFields(java.io.File f,
                                org.apache.lucene.document.Document doc,
                                java.lang.String category)
                         throws java.io.IOException
Convenience method, adds default fields to index entry

Parameters:
f - file to be indexed
doc - index entry
Throws:
java.io.IOException

getContentFromXML

protected java.io.Reader getContentFromXML(java.io.Reader input)
                                    throws java.io.IOException,
                                           org.xml.sax.SAXException,
                                           java.io.FileNotFoundException
Convenience method to process XML content

Parameters:
input - an XML reader
Returns:
a Reader containing all content for this XML input
Throws:
java.io.IOException
org.xml.sax.SAXException
java.io.FileNotFoundException


Copyright © 2005 Gumshoe Desktop Search Developers. All Rights Reserved.