source: trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/doctypes/TextDocument.java@ 5800

Last change on this file since 5800 was 5800, checked in by cs025, 20 years ago

Adding gs3build

  • Property svn:keywords set to Author Date Id Revision
File size: 762 bytes
Line 
1package org.greenstone.gsdl3.gs3build.doctypes;
2
3import java.io.File;
4import java.net.URL;
5import java.util.ArrayList;
6import java.util.List;
7import java.util.Map;
8
9/**
10 * A pretty basic DocumentInterface class - just able to
11 * provide unsophisticated access to the document as plain
12 * text, and no attempt at metadata extraction
13 */
14
15public class TextDocument extends AbstractDocument
16{
17 public static final String TEXT_DOCUMENT_TYPE = "Text";
18
19 public TextDocument(URL url)
20 { super(url);
21 }
22
23 public String getDocumentType()
24 { return TEXT_DOCUMENT_TYPE;
25 }
26
27 /**
28 * A pretty minimal and lazy document text extraction process.
29 */
30 public String getDocumentText()
31 { return DocumentLoader.getAsString((URL) this.fileSet.getFile(0).getLocation());
32 }
33}
Note: See TracBrowser for help on using the repository browser.