org.egothor.apps
Class Directory

java.lang.Object
  extended by org.egothor.apps.Directory

public class Directory
extends java.lang.Object

Use this program to process HTML files saved locally.

Author:
Leo Galambos

Constructor Summary
Directory(java.lang.String location)
          Constructor for the Directory object.
 
Method Summary
 void close()
          Save the Tanker's configuration and Barrels to a file.
 java.lang.String getCharset()
           
 long getUID(java.lang.String location)
           
 java.lang.String guessContentType(java.lang.String fname)
           
 void indexIt(File location, java.lang.String as)
          Index the given file.
static void main(java.lang.String[] argv)
          Entry point to the Directory application.
 void parse(File file, java.lang.String location, java.lang.String contentType, java.lang.String fileCharset)
          Parse the given file.
 void printL(File a)
          Print the given String to stdout.
 void printL(java.lang.String a)
           
 void setCharset(java.lang.String charset)
           
 void setLowercase(boolean lowercase)
          Set lowercase to the given value.
 void setPhonetics(boolean phonetics)
          Sets the phonetics attribute of the Directory object
 void setUpdateable(boolean updateable)
           
 void swLowercase()
          If using the lowercase don't, otherwise do.
 void swPhonetics()
          Description of the Method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Directory

public Directory(java.lang.String location)
Constructor for the Directory object.

Parameters:
location - the directory where the index is/will be created
Method Detail

setLowercase

public void setLowercase(boolean lowercase)
Set lowercase to the given value.

Parameters:
lowercase - The new lowercase value

setPhonetics

public void setPhonetics(boolean phonetics)
Sets the phonetics attribute of the Directory object

Parameters:
phonetics - The new phonetics value

getUID

public long getUID(java.lang.String location)

main

public static void main(java.lang.String[] argv)
Entry point to the Directory application. This program has one required parameter, the path to a directory where the index is/will be created. Additionally, this program has two optional parameters: "-csdia", which allows the program to handle Czech diacritical marks; or "-snippet", which requests creation of an index with support for snippets.

UIDs of the documents are assigned sequentially by default. If you want to update the index later, you would rather assign the ids by a hash function which generates id according to the location of a document. This can be achived with "-update".

Finally, a new directory for the index can be specified by an optional parameter "as", followed by the desired path.

Parameters:
argv - the command line arguments

swLowercase

public void swLowercase()
If using the lowercase don't, otherwise do.


swPhonetics

public void swPhonetics()
Description of the Method


indexIt

public final void indexIt(File location,
                          java.lang.String as)
Index the given file.

Parameters:
location - the file path
as - the directory to index in

guessContentType

public java.lang.String guessContentType(java.lang.String fname)

close

public void close()
Save the Tanker's configuration and Barrels to a file.


parse

public void parse(File file,
                  java.lang.String location,
                  java.lang.String contentType,
                  java.lang.String fileCharset)
Parse the given file. Only HTML files are picked out for indexing.

Parameters:
file - the file to parse
location - the path to the file

printL

public void printL(File a)
Print the given String to stdout.

Parameters:
a - the String to print

printL

public void printL(java.lang.String a)

getCharset

public java.lang.String getCharset()

setCharset

public void setCharset(java.lang.String charset)

setUpdateable

public void setUpdateable(boolean updateable)