MCPcopy Create free account
hub / github.com/GateNLP/gate-core / init

Method init

src/main/java/gate/corpora/TikaFormat.java:38–58  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

36 private static final Logger log = LoggerFactory.getLogger(TikaFormat.class);
37
38 @Override
39 public Resource init() throws ResourceInstantiationException {
40 super.init();
41 setMimeType(new MimeType("application","tika"));
42 assignMime(getMimeType());
43 assignMime(new MimeType("application","pdf"), "pdf");
44 assignMime(new MimeType("application","msword"), "doc");
45 assignMime(new MimeType("application","vnd.ms-powerpoint"), "ppt");
46 assignMime(new MimeType("application","vnd.ms-excel"), "xls");
47 assignMime(new MimeType("application","vnd.openxmlformats-officedocument.wordprocessingml.document"), "docx");
48 assignMime(new MimeType("application","vnd.openxmlformats-officedocument.presentationml.presentation"), "pptx");
49 assignMime(new MimeType("application","vnd.openxmlformats-officedocument.spreadsheetml.sheet"), "xlsx");
50 assignMime(new MimeType("application", "vnd.oasis.opendocument.text"), "odt");
51 assignMime(new MimeType("application", "vnd.oasis.opendocument.presentation"), "odp");
52 assignMime(new MimeType("application", "vnd.oasis.opendocument.spreadsheet"), "ods");
53 assignMime(new MimeType("application", "rtf"), "rtf");
54
55 //There are bugs in Tika related to ePub as of 0.7
56 //assignMime(new MimeType("application", "epub+zip"), "epub");
57 return this;
58 }
59
60 private void assignMime(MimeType mime, String... exts) {
61 String mimeString = mime.getType()+ "/" + mime.getSubtype();

Callers

nothing calls this directly

Calls 4

assignMimeMethod · 0.95
initMethod · 0.65
setMimeTypeMethod · 0.45
getMimeTypeMethod · 0.45

Tested by

no test coverage detected