We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 96a4f4a commit dec141dCopy full SHA for dec141d
src/main/java/org/jabref/gui/externalfiles/ImportHandler.java
@@ -405,12 +405,15 @@ public List<BibEntry> handleStringData(String data) throws FetcherException {
405
}
406
LOGGER.trace("Checking if URL is a PDF: {}", data);
407
408
- if (URLUtil.isURL(data) && data.toLowerCase().endsWith(".pdf")) {
409
- try {
410
- return handlePdfUrl(data);
411
- } catch (IOException ex) {
412
- LOGGER.error("Could not handle PDF URL", ex);
413
- return List.of();
+ if (URLUtil.isURL(data)) {
+ String fileName = data.substring(data.lastIndexOf('/') + 1);
+ if (FileUtil.isPDFFile(Path.of(fileName))) {
+ try {
+ return handlePdfUrl(data);
+ } catch (IOException ex) {
414
+ LOGGER.error("Could not handle PDF URL", ex);
415
+ return List.of();
416
+ }
417
418
419
0 commit comments