You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tika.apache.org by ta...@apache.org on 2023/05/24 21:49:39 UTC

[tika] branch TIKA-4002 created (now 57cbc6a16)

This is an automated email from the ASF dual-hosted git repository.

tallison pushed a change to branch TIKA-4002
in repository https://gitbox.apache.org/repos/asf/tika.git


      at 57cbc6a16 TIKA-4002 -- add mime type detection for pcapng

This branch includes the following new commits:

     new 57cbc6a16 TIKA-4002 -- add mime type detection for pcapng

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[tika] 01/01: TIKA-4002 -- add mime type detection for pcapng

Posted by ta...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tallison pushed a commit to branch TIKA-4002
in repository https://gitbox.apache.org/repos/asf/tika.git

commit 57cbc6a166fffd7c1c00156e33475d2cb5e0c259
Author: tballison <ta...@apache.org>
AuthorDate: Wed May 24 17:49:31 2023 -0400

    TIKA-4002 -- add mime type detection for pcapng
---
 .../main/resources/org/apache/tika/mime/tika-mimetypes.xml   | 12 ++++++++++++
 .../src/test/java/org/apache/tika/mime/OneOffMimeTest.java   |  5 +++--
 2 files changed, 15 insertions(+), 2 deletions(-)

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 84425c3e1..5b0a479fe 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
@@ -2918,6 +2918,18 @@
     <glob pattern="*.cap"/>
     <glob pattern="*.dmp"/>
   </mime-type>
+  <mime-type type="application/vnd.tcpdump.pcapng">
+    <_comment>TCPDump next gen pcap packet capture</_comment>
+    <tika:link>https://www.ietf.org/staging/draft-tuexen-opsawg-pcapng-02.html</tika:link>
+    <magic priority="50">
+      <match value="0x0A0D0D0A" type="string" offset="0">
+        <!-- Could only find examples of the second. I have not tested the first -->
+        <match value="0xa1b2c3d4" type="big32" offset="8" />
+        <match value="0x4d3c2b1a" type="string" offset="8" />
+      </match>
+    </magic>
+    <glob pattern="*.pcapng"/>
+  </mime-type>
 
   <mime-type type="application/vnd.tmobile-livetv">
     <glob pattern="*.tmo"/>
diff --git a/tika-parsers/tika-parsers-standard/tika-parsers-standard-package/src/test/java/org/apache/tika/mime/OneOffMimeTest.java b/tika-parsers/tika-parsers-standard/tika-parsers-standard-package/src/test/java/org/apache/tika/mime/OneOffMimeTest.java
index 8f1b628df..45c491639 100644
--- a/tika-parsers/tika-parsers-standard/tika-parsers-standard-package/src/test/java/org/apache/tika/mime/OneOffMimeTest.java
+++ b/tika-parsers/tika-parsers-standard/tika-parsers-standard-package/src/test/java/org/apache/tika/mime/OneOffMimeTest.java
@@ -39,8 +39,9 @@ public class OneOffMimeTest extends TikaTest {
             "cannot be added to Tika's repo.")
     @Test
     public void testOne() throws Exception {
-        Path p = Paths.get("");
-        String mime = "audio/x-sap";
+        Path baseDir = Paths.get("");
+        Path p = baseDir.resolve("");
+        String mime = "application/vnd.tcpdump.pcapng";
         assertByData(mime, p);
         assertByName(mime, p);
     }