Repository: tika Updated Branches: refs/heads/2.x b600b6701 -> 2f5537380
TIKA-2009 -- add detection for Endnote Import files Project: http://git-wip-us.apache.org/repos/asf/tika/repo Commit: http://git-wip-us.apache.org/repos/asf/tika/commit/2f553738 Tree: http://git-wip-us.apache.org/repos/asf/tika/tree/2f553738 Diff: http://git-wip-us.apache.org/repos/asf/tika/diff/2f553738 Branch: refs/heads/2.x Commit: 2f5537380fb5b73367dbcca67fdcea5b6d19be39 Parents: b600b67 Author: tballison <[email protected]> Authored: Wed Jun 15 10:44:41 2016 -0400 Committer: tballison <[email protected]> Committed: Wed Jun 15 10:44:41 2016 -0400 ---------------------------------------------------------------------- CHANGES.txt | 13 ++++++------- .../test/java/org/apache/tika/mime/TestMimeTypes.java | 6 ++++++ .../resources/org/apache/tika/mime/tika-mimetypes.xml | 12 ++++++++++++ .../resources/test-documents/testEndNoteImportFile.enw | 10 ++++++++++ 4 files changed, 34 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tika/blob/2f553738/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 8984c90..1c93618 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -10,13 +10,12 @@ Release 2.0 - Future Development Release 1.14 - ??? - * Add mime magic for DJVU files (TIKA-2009). - - * Add mime definition and parser for MS Owner File (TIKA-2008). - - * Add mime definition for Windows Media Metafile (TIKA-2004). - - * Add mime definitions of iCal and vCalendar (TIKA-2006). + * Add mime types, mime magic and/or globs for: + * Endnote Import File (TIKA-2011) + * DJVU files (TIKA-2009) + * MS Owner File (TIKA-2008) + * Windows Media Metafile (TIKA-2004) + * iCal and vCalendar (TIKA-2006) * Upgrade to PDFBox 2.0.2 (TIKA-1996). http://git-wip-us.apache.org/repos/asf/tika/blob/2f553738/tika-app/src/test/java/org/apache/tika/mime/TestMimeTypes.java ---------------------------------------------------------------------- diff --git a/tika-app/src/test/java/org/apache/tika/mime/TestMimeTypes.java b/tika-app/src/test/java/org/apache/tika/mime/TestMimeTypes.java index 38c8fb1..09864b8 100644 --- a/tika-app/src/test/java/org/apache/tika/mime/TestMimeTypes.java +++ b/tika-app/src/test/java/org/apache/tika/mime/TestMimeTypes.java @@ -995,6 +995,12 @@ public class TestMimeTypes extends TikaTest { assertTypeByData("image/vnd.djvu", "testDJVU.djvu"); } + @Test + public void testEndNoteImport() throws Exception { + assertType("application/x-endnote-refer", "testEndNoteImportFile.enw"); + assertTypeByData("application/x-endnote-refer", "testEndNoteImportFile.enw"); + } + private void assertText(byte[] prefix) throws IOException { assertMagic("text/plain", prefix); } http://git-wip-us.apache.org/repos/asf/tika/blob/2f553738/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml ---------------------------------------------------------------------- diff --git a/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml b/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml index 0f0ea86..83cd239 100644 --- a/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml +++ b/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml @@ -3060,6 +3060,18 @@ <sub-class-of type="text/x-tika-text-based-message"/> </mime-type> + <mime-type type="application/x-endnote-refer"> + <magic priority="80"> + <match value="%A " type="string" offset="0:50"> + <match value="\n%D " type="string" offset="0:1000"> + <match value="\n%T " type="string" offset="0:1000"/> + </match> + </match> + </magic> + <glob pattern="*.enw"/> + <glob pattern="*.enr"/> + </mime-type> + <mime-type type="application/x-killustrator"> <_comment>KIllustrator File</_comment> <glob pattern="*.kil"/> http://git-wip-us.apache.org/repos/asf/tika/blob/2f553738/tika-test-resources/src/test/resources/test-documents/testEndNoteImportFile.enw ---------------------------------------------------------------------- diff --git a/tika-test-resources/src/test/resources/test-documents/testEndNoteImportFile.enw b/tika-test-resources/src/test/resources/test-documents/testEndNoteImportFile.enw new file mode 100644 index 0000000..7a68fcf --- /dev/null +++ b/tika-test-resources/src/test/resources/test-documents/testEndNoteImportFile.enw @@ -0,0 +1,10 @@ +%A Fasouliotis, S J +%A Schenker, J G +%D 1997 +%J Eur J Obstet Gynecol Reprod Biol +%N 2 +%P 183-90 +%T Multifetal pregnancy reduction: a review of the world results for the period 1993-1996. +%U +%V 75 +%@ 0301-2115 \ No newline at end of file
