Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions data/fileTypes/eml_sample.eml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
From: Study Coordinator <coordinator@example.com>
To: Assay Team <assay-team@example.com>
Cc: Data Manager <data-manager@example.com>
Subject: Plate reader results for batch 42
Date: Tue, 06 Oct 2026 14:30:00 -0700
Message-ID: <eml-sample-0001@example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

Hello team,

The plate reader results for batch 42 are uploaded to the pipeline root.
Please review the outlier wells before Friday's QC meeting.

Thanks,
Study Coordinator
Binary file added data/fileTypes/sas7bdat_sample.sas7bdat
Binary file not shown.
6 changes: 4 additions & 2 deletions src/org/labkey/serverapi/reader/FileType.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@
import org.apache.tika.detect.Detector;
import org.apache.tika.io.TikaInputStream;
import org.apache.tika.metadata.Metadata;
import org.apache.tika.metadata.TikaCoreProperties;
import org.apache.tika.mime.MediaType;
import org.apache.tika.mime.MimeTypes;
import org.apache.tika.parser.ParseContext;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

Expand Down Expand Up @@ -261,10 +263,10 @@ public boolean isType(@Nullable String filePath, @Nullable String contentType, @
protected static String detectContentType(String fileName, byte[] header)
{
final Metadata metadata = new Metadata();
metadata.set("resourceName", fileName);
metadata.set(TikaCoreProperties.RESOURCE_NAME_KEY, fileName);
try (TikaInputStream is = TikaInputStream.get(header, metadata))
{
MediaType mediaType = DETECTOR.detect(is, metadata);
MediaType mediaType = DETECTOR.detect(is, metadata, new ParseContext());
if (mediaType != null)
return mediaType.toString();

Expand Down
Loading