Skip to content

Commit

Permalink
Updated condition to add file content if it has mime type text/html
Browse files Browse the repository at this point in the history
  • Loading branch information
milanmajchrak committed Oct 30, 2023
1 parent 28e5a89 commit ba68655
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ private List<FileInfo> getFilePreviewContent(Context context, Bitstream bitstrea
private List<FileInfo> processInputStreamToFilePreview(Context context, Bitstream bitstream,
List<FileInfo> 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 {
Expand Down

0 comments on commit ba68655

Please sign in to comment.