mirror of
https://github.com/sismics/docs.git
synced 2025-12-14 02:06:25 +00:00
Closes #116: Allow all file types
This commit is contained in:
@@ -64,7 +64,7 @@ public class PdfUtil {
|
||||
PDFTextStripper stripper = new PDFTextStripper();
|
||||
pdfDocument = PDDocument.load(inputStream);
|
||||
content = stripper.getText(pdfDocument);
|
||||
} catch (IOException e) {
|
||||
} catch (Exception e) {
|
||||
log.error("Error while extracting text from the PDF", e);
|
||||
} finally {
|
||||
if (pdfDocument != null) {
|
||||
|
||||
@@ -19,4 +19,6 @@ public class MimeType {
|
||||
public static final String OPEN_DOCUMENT_TEXT = "application/vnd.oasis.opendocument.text";
|
||||
|
||||
public static final String OFFICE_DOCUMENT = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
|
||||
|
||||
public static final String DEFAULT = "application/octet-stream";
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ public class MimeTypeUtil {
|
||||
return MimeType.APPLICATION_PDF;
|
||||
}
|
||||
|
||||
return null;
|
||||
return MimeType.DEFAULT;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user