source: trunk/indexers/lucene-gs/src/org/greenstone/LuceneWrapper/IndexXML.java@ 12257

Last change on this file since 12257 was 12257, checked in by mdewsnip, 18 years ago

Added package definitions.

  • Property svn:keywords set to Author Date Id Revision
File size: 980 bytes
Line 
1
2/**
3 *
4 * @author [email protected]
5 * @author [email protected]
6 * @version
7 */
8
9package org.nzdl.gsdl.LuceneWrap;
10
11
12import java.io.File;
13
14public class IndexXML extends Object {
15
16 String doc_tag_level_ = null;
17 File out_dir_ = null;
18 Indexer indexer_ = null;
19 boolean create_index_ = false;
20
21 public IndexXML(String doc_tag_level, File out_dir, boolean create)
22 {
23 doc_tag_level_ = doc_tag_level;
24 out_dir_ = out_dir;
25 create_index_ = create;
26 }
27
28 public void init()
29 {
30 indexer_ = new Indexer(doc_tag_level_, out_dir_, create_index_);
31 }
32
33 public void finish()
34 {
35 indexer_.finish();
36 }
37
38 public void indexFile(File file)
39 {
40 String name = file.getName();
41 name = name.substring(0, name.lastIndexOf('.'));
42 System.out.println("Indexing "+file.getPath()+" with id "+name);
43 indexer_.index(name, file);
44 }
45
46 public void indexFile(String xml_text)
47 {
48 indexer_.index(xml_text);
49 }
50
51}
Note: See TracBrowser for help on using the repository browser.