Last change
on this file since 12188 was 12188, checked in by kjdon, 18 years ago |
Initial revision
|
-
Property svn:keywords
set to
Author Date Id Revision
|
File size:
1.0 KB
|
Line | |
---|
1 | package org.greenstone.gsdl3.gs3build.doctypes;
|
---|
2 |
|
---|
3 | import java.io.File;
|
---|
4 | import java.net.URL;
|
---|
5 | import java.util.ArrayList;
|
---|
6 | import java.util.List;
|
---|
7 | import 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 |
|
---|
15 | public class TextDocument extends AbstractDocument
|
---|
16 | {
|
---|
17 | public static final String TEXT_DOCUMENT_TYPE = "Text";
|
---|
18 |
|
---|
19 | public TextDocument(DocumentID id)
|
---|
20 | { super(id);
|
---|
21 | }
|
---|
22 |
|
---|
23 | public TextDocument(URL url)
|
---|
24 | { super(url);
|
---|
25 | }
|
---|
26 |
|
---|
27 | public String getDocumentType()
|
---|
28 | { return TEXT_DOCUMENT_TYPE;
|
---|
29 | }
|
---|
30 |
|
---|
31 | /**
|
---|
32 | * A pretty minimal and lazy document text extraction process.
|
---|
33 | */
|
---|
34 | public String getDocumentText()
|
---|
35 | { return DocumentLoader.getAsString((URL) this.fileSet.getFile(0).getLocation());
|
---|
36 | }
|
---|
37 |
|
---|
38 | /**
|
---|
39 | * Text documents don't actually have more than one section (at present), so
|
---|
40 | * this is a dummy function...
|
---|
41 | */
|
---|
42 | public String getSectionText(String sectionId)
|
---|
43 | { return null;
|
---|
44 | }
|
---|
45 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.