From 4530d2d0ee5159b6b7a0a2e63fe053bf93a5cb68 Mon Sep 17 00:00:00 2001 From: Greg DiCristofaro Date: Thu, 26 Jan 2023 10:56:15 -0500 Subject: [PATCH] mime type updates --- .../autopsy/coreutils/FileTypeUtils.java | 48 ++++++++++++++----- 1 file changed, 37 insertions(+), 11 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/coreutils/FileTypeUtils.java b/Core/src/org/sleuthkit/autopsy/coreutils/FileTypeUtils.java index b45b3b68677..bdd8e3c7dcd 100644 --- a/Core/src/org/sleuthkit/autopsy/coreutils/FileTypeUtils.java +++ b/Core/src/org/sleuthkit/autopsy/coreutils/FileTypeUtils.java @@ -33,16 +33,17 @@ */ public final class FileTypeUtils { + // lists augmented with https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types private static final ImmutableSet IMAGE_MIME_TYPES = new ImmutableSet.Builder() .addAll(removeAll( asList( - // remove any empty mime types provided by ImageIO.getReaderMIMETypes() - // This prevents mime types added by SPI implementations from causing errors - // (i.e. 'jai-imageio' utilized with IcePDF) - Arrays.stream(ImageIO.getReaderMIMETypes()) - .filter((mimeType) -> StringUtils.isNotBlank(mimeType)) - .toArray(String[]::new)), + // remove any empty mime types provided by ImageIO.getReaderMIMETypes() + // This prevents mime types added by SPI implementations from causing errors + // (i.e. 'jai-imageio' utilized with IcePDF) + Arrays.stream(ImageIO.getReaderMIMETypes()) + .filter((mimeType) -> StringUtils.isNotBlank(mimeType)) + .toArray(String[]::new)), asList("application/octet-stream"))) //this claims to be supported, but is not really an image. .add("image/bmp", //NON-NLS "image/gif", //NON-NLS @@ -59,7 +60,9 @@ public final class FileTypeUtils { "image/x-ms-bmp", //NON-NLS "image/x-xbitmap", //NON-NLS "image/x-portable-graymap", //NON-NLS - "image/x-portable-bitmap" //NON-NLS + "image/x-portable-bitmap", //NON-NLS + "image/avif", //NON-NLS + "image/svg+xml" //NON-NLS ).build(); private static final ImmutableSet AUDIO_MIME_TYPES = new ImmutableSet.Builder() @@ -69,7 +72,13 @@ public final class FileTypeUtils { "audio/ogg", //NON-NLS "audio/wav", //NON-NLS "audio/vnd.wave", //NON-NLS - "audio/x-ms-wma"//NON-NLS + "audio/x-ms-wma",//NON-NLS + "application/x-cdf",//NON-NLS + "audio/aac",//NON-NLS + "audio/x-midi",//NON-NLS + "audio/opus",//NON-NLS + "audio/3gpp", //NON-NLS + "audio/3gpp2" //NON-NLS ).build(); private static final ImmutableSet VIDEO_MIME_TYPES = new ImmutableSet.Builder() @@ -83,7 +92,9 @@ public final class FileTypeUtils { "video/x-msvideo", //NON-NLS "video/x-flv", //NON-NLS "video/x-m4v", //NON-NLS - "video/x-ms-wmv"//NON-NLS + "video/x-ms-wmv",//NON-NLS + "video/mp2t", //NON-NLS + "video/webm" //NON-NLS ).build(); private static final ImmutableSet DOCUMENT_MIME_TYPES = new ImmutableSet.Builder() @@ -112,7 +123,21 @@ public final class FileTypeUtils { "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", //NON-NLS "application/vnd.oasis.opendocument.presentation", //NON-NLS "application/vnd.oasis.opendocument.spreadsheet", //NON-NLS - "application/vnd.oasis.opendocument.text" //NON-NLS + "application/vnd.oasis.opendocument.text", //NON-NLS + "application/epub+zip",//NON-NLS + "application/ld+json",//NON-NLS + "application/vnd.amazon.ebook",//NON-NLS + "application/vnd.visio",//NON-NLS + "application/x-abiword",//NON-NLS + "text/xml",//NON-NLS + "application/atom+xml",//NON-NLS + "text/calendar",//NON-NLS + "text/javascript",//NON-NLS + "application/vnd.mozilla.xul+xml",//NON-NLS + "application/x-csh",//NON-NLS + "application/x-httpd-php",//NON-NLS + "application/x-sh"//NON-NLS + ).build(); private static final ImmutableSet EXECUTABLE_MIME_TYPES = new ImmutableSet.Builder() @@ -126,7 +151,8 @@ public final class FileTypeUtils { "vms/exe",//NON-NLS "application/x-winexe",//NON-NLS "application/msdos-windows",//NON-NLS - "application/x-msdos-program"//NON-NLS + "application/x-msdos-program",//NON-NLS, + "application/java-archive" //NON-NLS ).build(); private static final ImmutableSet MULTI_MEDIA_MIME_TYPES = new ImmutableSet.Builder()