public class Directory extends Object
Constructor and Description |
---|
Directory(String location)
Constructor for the Directory object.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Save the Tanker's configuration and Barrels to a file.
|
String |
getCharset() |
long |
getUID(String location) |
String |
guessContentType(String fname) |
void |
indexIt(File location,
String as)
Index the given file.
|
static void |
main(String[] argv)
Entry point to the Directory application.
|
void |
parse(File file,
String location,
String contentType,
String fileCharset)
Parse the given file.
|
void |
printL(File a)
Print the given String to stdout.
|
void |
printL(String a) |
void |
setCharset(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
|
public Directory(String location)
location
- the directory where the index is/will be createdpublic void setLowercase(boolean lowercase)
lowercase
- The new lowercase valuepublic void setPhonetics(boolean phonetics)
phonetics
- The new phonetics valuepublic long getUID(String location)
location
- public static void main(String[] argv)
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.
argv
- the command line argumentspublic void swLowercase()
public void swPhonetics()
public final void indexIt(File location, String as)
location
- the file pathas
- the directory to index inpublic void close()
public void parse(File file, String location, String contentType, String fileCharset)
file
- the file to parselocation
- the path to the filecontentType
- fileCharset
- public void printL(File a)
a
- the String to printpublic void printL(String a)
a
- public String getCharset()
public void setCharset(String charset)
charset
- public void setUpdateable(boolean updateable)
updateable
- Copyright © 2016 Egothor. All Rights Reserved.