minor attachments cleanups: IDE test support and EPUB format
The documentation says we support EPUB, but the parser is not enabled. This parser does not require any external dependencies, so I think its ok? Separately, test-framework drags in an ancient commons-codec (via httpclient), which gradle "upgrades", but IDEs can't handle this case and just hit jar hell. So just wire that to 1.9, this allows running tests in the IDE for this plugin.
This commit is contained in:
parent
013347be9b
commit
ac612208b7
|
@ -55,4 +55,5 @@ compileJava.options.compilerArgs << '-Xlint:-cast,-deprecation,-rawtypes'
|
||||||
forbiddenPatterns {
|
forbiddenPatterns {
|
||||||
exclude '**/*.docx'
|
exclude '**/*.docx'
|
||||||
exclude '**/*.pdf'
|
exclude '**/*.pdf'
|
||||||
|
exclude '**/*.epub'
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,6 +67,7 @@ final class TikaImpl {
|
||||||
new org.apache.tika.parser.odf.OpenDocumentParser(),
|
new org.apache.tika.parser.odf.OpenDocumentParser(),
|
||||||
new org.apache.tika.parser.iwork.IWorkPackageParser(),
|
new org.apache.tika.parser.iwork.IWorkPackageParser(),
|
||||||
new org.apache.tika.parser.xml.DcXMLParser(),
|
new org.apache.tika.parser.xml.DcXMLParser(),
|
||||||
|
new org.apache.tika.parser.epub.EpubParser(),
|
||||||
};
|
};
|
||||||
|
|
||||||
/** autodetector based on this subset */
|
/** autodetector based on this subset */
|
||||||
|
|
|
@ -96,6 +96,14 @@ public class VariousDocTests extends AttachmentUnitTestCase {
|
||||||
assertParseable("text-in-english.txt");
|
assertParseable("text-in-english.txt");
|
||||||
testMapper("text-in-english.txt", false);
|
testMapper("text-in-english.txt", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test for .epub
|
||||||
|
*/
|
||||||
|
public void testEpubDocument() throws Exception {
|
||||||
|
assertParseable("testEPUB.epub");
|
||||||
|
testMapper("testEPUB.epub", false);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test for ASCIIDOC
|
* Test for ASCIIDOC
|
||||||
|
|
Binary file not shown.
|
@ -33,7 +33,10 @@ dependencies {
|
||||||
compile('org.hamcrest:hamcrest-all:1.3') {
|
compile('org.hamcrest:hamcrest-all:1.3') {
|
||||||
exclude group: 'org.hamcrest', module: 'hamcrest-core'
|
exclude group: 'org.hamcrest', module: 'hamcrest-core'
|
||||||
}
|
}
|
||||||
compile "org.apache.httpcomponents:httpclient:${versions.httpclient}"
|
compile("org.apache.httpcomponents:httpclient:${versions.httpclient}") {
|
||||||
|
exclude group: 'commons-codec', module: 'commons-codec'
|
||||||
|
}
|
||||||
|
compile "commons-codec:commons-codec:1.9"
|
||||||
}
|
}
|
||||||
|
|
||||||
compileJava.options.compilerArgs << '-Xlint:-cast,-deprecation,-fallthrough,-overrides,-rawtypes,-serial,-try,-unchecked'
|
compileJava.options.compilerArgs << '-Xlint:-cast,-deprecation,-fallthrough,-overrides,-rawtypes,-serial,-try,-unchecked'
|
||||||
|
|
Loading…
Reference in New Issue