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 09b8e3821e..54f4b2051d 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 @@ -2072,7 +2072,10 @@ - + + @@ -7041,7 +7044,17 @@ - + + + + + + + + + <_comment>no magic available + + DWF <_comment>AutoCAD Design Web Format diff --git a/tika-core/src/test/java/org/apache/tika/TikaDetectionTest.java b/tika-core/src/test/java/org/apache/tika/TikaDetectionTest.java index 1cd0f40a27..79fd61f348 100644 --- a/tika-core/src/test/java/org/apache/tika/TikaDetectionTest.java +++ b/tika-core/src/test/java/org/apache/tika/TikaDetectionTest.java @@ -354,7 +354,7 @@ public void testHttpServerFileExtensions() { assertEquals("application/vnd.ms-ims", tika.detect("x.ims")); assertEquals("application/vnd.ms-lrm", tika.detect("x.lrm")); assertEquals("application/vnd.ms-pki.seccat", tika.detect("x.cat")); - assertEquals("application/vnd.ms-pki.stl", tika.detect("x.stl")); + assertEquals("model/x.stl-binary", tika.detect("x.stl")); assertEquals("application/vnd.ms-powerpoint", tika.detect("x.ppt")); assertEquals("application/vnd.ms-powerpoint", tika.detect("x.pps")); assertEquals("application/vnd.ms-powerpoint", tika.detect("x.pot")); diff --git a/tika-parsers/tika-parsers-standard/tika-parsers-standard-package/src/test/java/org/apache/tika/mime/TestMimeTypes.java b/tika-parsers/tika-parsers-standard/tika-parsers-standard-package/src/test/java/org/apache/tika/mime/TestMimeTypes.java index 3dad7d6aff..886fe4ad66 100644 --- a/tika-parsers/tika-parsers-standard/tika-parsers-standard-package/src/test/java/org/apache/tika/mime/TestMimeTypes.java +++ b/tika-parsers/tika-parsers-standard/tika-parsers-standard-package/src/test/java/org/apache/tika/mime/TestMimeTypes.java @@ -212,6 +212,12 @@ public void testSRT() throws Exception { assertTypeByNameAndData("application/x-subrip", "test_subrip.srt"); } + @Test + public void testSTL() throws Exception { + assertTypeByNameAndData("model/x.stl-binary", "testSTL-binary.stl"); + assertTypeByNameAndData("model/x.stl-ascii", "testSTL-ascii.stl"); + } + @Test public void testTTML() throws Exception { assertTypeByData("application/ttml+xml", "test_ttml.ttml"); diff --git a/tika-parsers/tika-parsers-standard/tika-parsers-standard-package/src/test/resources/test-documents/testSTL-ascii.stl b/tika-parsers/tika-parsers-standard/tika-parsers-standard-package/src/test/resources/test-documents/testSTL-ascii.stl new file mode 100644 index 0000000000..9d5bfe0852 --- /dev/null +++ b/tika-parsers/tika-parsers-standard/tika-parsers-standard-package/src/test/resources/test-documents/testSTL-ascii.stl @@ -0,0 +1,16 @@ +solid OpenSCAD_Model + facet normal 0 0 -1 + outer loop + vertex -10 -35 0 + vertex 10 -25 0 + vertex 10 -35 0 + endloop + endfacet + facet normal -0 0 -1 + outer loop + vertex 10 -25 0 + vertex -10 -35 0 + vertex -10 -25 0 + endloop + endfacet +endsolid OpenSCAD_Model diff --git a/tika-parsers/tika-parsers-standard/tika-parsers-standard-package/src/test/resources/test-documents/testSTL-binary.stl b/tika-parsers/tika-parsers-standard/tika-parsers-standard-package/src/test/resources/test-documents/testSTL-binary.stl new file mode 100644 index 0000000000..e76f48fd16 Binary files /dev/null and b/tika-parsers/tika-parsers-standard/tika-parsers-standard-package/src/test/resources/test-documents/testSTL-binary.stl differ