From a3b90fd59e336a43416ac4148c1d2b5dddcf62ac Mon Sep 17 00:00:00 2001 From: milanmajchrak <90026355+milanmajchrak@users.noreply.github.com> Date: Mon, 30 Oct 2023 10:33:05 +0100 Subject: [PATCH] ufal/be-generate-preview-for-html --- .../app/rest/repository/MetadataBitstreamRestRepository.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/MetadataBitstreamRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/MetadataBitstreamRestRepository.java index 4f4ca065cdaa..8208a662ce79 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/MetadataBitstreamRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/MetadataBitstreamRestRepository.java @@ -226,7 +226,8 @@ private List getFilePreviewContent(Context context, Bitstream bitstrea private List processInputStreamToFilePreview(Context context, Bitstream bitstream, List fileInfos, InputStream inputStream) throws IOException, SQLException, ParserConfigurationException, SAXException, ArchiveException { - if (bitstream.getFormat(context).getMIMEType().equals("text/plain")) { + String bitstreamMimeType = bitstream.getFormat(context).getMIMEType(); + if (bitstreamMimeType.equals("text/plain") || bitstreamMimeType.equals("text/html")) { String data = getFileContent(inputStream); fileInfos.add(new FileInfo(data, false)); } else {