1
2
3
4
5
6
7 package net.sf.gumshoe.indexer;
8
9 import java.io.File;
10 import java.io.FileReader;
11 import java.util.List;
12 import java.util.Vector;
13
14
15 import org.apache.lucene.document.Document;
16 import org.apache.lucene.document.Field;
17
18 /***
19 * @author Gabor
20 *
21 * TODO To change the template for this generated type comment go to
22 * Window - Preferences - Java - Code Style - Code Templates
23 */
24 public class DefaultContentReader extends ContentReader {
25 /***
26 *
27 */
28 public DefaultContentReader() {
29 super();
30 }
31
32 /*** Default category is none
33 * @see net.sf.gumshoe.indexer.ContentReader#getCategory()
34 */
35 public String getCategory() {
36 return "";
37 }
38
39
40
41
42 public Document getDocument(File f) throws Exception {
43 Document doc = new Document();
44 addDefaultFields(f, doc, "");
45 doc.add(Field.Text(CONTENTS, new FileReader(f)));
46 return doc;
47 }
48
49
50
51
52 public List getSupportedExtensions() {
53 List extensions=new Vector();
54 extensions.add("*");
55 return extensions;
56 }
57 }