Skip to content

Commit 55171e6

Browse files
authored
Merge pull request #6119 from JabRef/lowercase-file-extension
Lowercase file extension
2 parents 209d336 + a775858 commit 55171e6

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
2020
### Fixed
2121

2222
- We fixed an issue where opening a library from the recent libraries menu was not possible. [#5939](https://github.com/JabRef/jabref/issues/5939)
23+
- We fixed an issue with inconsistent capitalization of file extensions when downloading files [#6115](https://github.com/JabRef/jabref/issues/6115)
2324

2425
### Removed
2526

src/main/java/org/jabref/gui/fieldeditors/LinkedFileViewModel.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -421,10 +421,10 @@ public BackgroundTask<Path> prepareDownloadTask(Path targetDirectory, URLDownloa
421421
BackgroundTask<Path> downloadTask = BackgroundTask
422422
.wrap(() -> {
423423
Optional<ExternalFileType> suggestedType = inferFileType(urlDownload);
424-
String suggestedTypeName = suggestedType.orElse(StandardExternalFileType.PDF).getName();
424+
ExternalFileType externalFileType = suggestedType.orElse(StandardExternalFileType.PDF);
425+
String suggestedTypeName = externalFileType.getName();
425426
linkedFile.setFileType(suggestedTypeName);
426-
427-
String suggestedName = linkedFileHandler.getSuggestedFileName(suggestedTypeName);
427+
String suggestedName = linkedFileHandler.getSuggestedFileName(externalFileType.getExtension());
428428
return targetDirectory.resolve(suggestedName);
429429
})
430430
.then(destination -> new FileDownloadTask(urlDownload.getSource(), destination))

0 commit comments

Comments
 (0)