View Javadoc

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