|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.labs.minion.samples.MailIndexer
public class MailIndexer
A main class that indexes a simplified RFC-822ish mail format (mostly fewer headers and no MIME). The aim is to be able to do regression testing on changes to the field store to make sure that it's working correctly.
Field Summary | |
---|---|
protected SearchEngine |
engine
The engine that we'll use for searching. |
protected java.util.regex.Pattern |
header
A regex pattern for rfc822 headers. |
Constructor Summary | |
---|---|
MailIndexer(java.lang.String indexDir)
Creates a mail indexer that will index into the given directory. |
Method Summary | |
---|---|
void |
close()
Closes the search engine. |
SearchEngine |
getSearchEngine()
|
void |
indexMBox(java.lang.String mbox)
|
void |
indexMBox(java.lang.String mbox,
java.lang.String strip)
Indexes a mailbox at a given path |
void |
indexMBox(java.net.URL mbox)
|
void |
indexMBox(java.net.URL mbox,
java.lang.String strip)
Indexes a mailbox at a given location |
static void |
main(java.lang.String[] args)
A main program to index a number of mbox files given on the command line. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected SearchEngine engine
protected java.util.regex.Pattern header
Constructor Detail |
---|
public MailIndexer(java.lang.String indexDir) throws SearchEngineException
indexDir
- the name of the directory where the index data will be
stored
SearchEngineException
- if there is any error
opening the engine.Method Detail |
---|
public SearchEngine getSearchEngine()
public void close() throws SearchEngineException
SearchEngineException
public void indexMBox(java.lang.String mbox) throws java.io.IOException, SearchEngineException
java.io.IOException
SearchEngineException
public void indexMBox(java.lang.String mbox, java.lang.String strip) throws java.io.IOException, SearchEngineException
mbox
- the path to the mbox file we want to indexstrip
- a string to strip from the starts of subjects.
java.io.IOException
SearchEngineException
public void indexMBox(java.net.URL mbox) throws java.io.IOException, SearchEngineException
java.io.IOException
SearchEngineException
public void indexMBox(java.net.URL mbox, java.lang.String strip) throws java.io.IOException, SearchEngineException
mbox
- the path to the mbox file we want to index
java.io.IOException
SearchEngineException
public static void main(java.lang.String[] args) throws java.io.IOException, SearchEngineException
args
- the command line arguments
java.io.IOException
- if there is any exception reading the mbox
files
SearchEngineException
- if there is any error
indexing the data
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |