Skip to content

Commit c0f60e0

Browse files
committed
Merge remote-tracking branch 'upstream/master' into moveFileDir
* upstream/master: (21 commits) Implement #1904: filter groups (#2588) Braces checking followup (#2598) Improve braces checking (#2593) Fix pdf file import when only one file selected and no entry created (#2592) Fix test Imports Localization: MainFile: French: update (#2591) isPdf helper method Add asString with UTF-8 as standard encoding Fix names of groups in "add/move to group" dialog Make automatic groups a first-class citizien (#2563) Rename downloadToString method to asString Refactoring method names Inline Mime type detection Fix imports Extract SSL bypassing Bypass SSL functionality Unused methods and refactoring Always use browser user agent Monitored URLDownload is currently not use anywhere ... # Conflicts: # CHANGELOG.md
2 parents 76884c2 + 48f5293 commit c0f60e0

File tree

66 files changed

+1164
-1274
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1164
-1274
lines changed

CHANGELOG.md

+10-6
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
1717
- Redesigned group panel.
1818
- Number of matched entries is always shown.
1919
- The background color of the hit counter signals whether the group contains all/any of the entries selected in the main table.
20+
- Added a possibility to filter the groups panel [#1904](https://github.com/JabRef/jabref/issues/1904)
2021
- Removed edit mode.
2122
- Redesigned about dialog.
2223
- Redesigned key bindings dialog.
@@ -45,12 +46,15 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
4546
- The field `issue` is now always exported to the corresponding `issue` field in MS-Office XML.
4647
- We fixed an issue with repeated escaping of the %-sign when running the LaTeXCleanup more than once. [#2451](https://github.com/JabRef/jabref/issues/2451)
4748
- We fixed the import of MS-Office XML files, when the `month` field contained an invalid value.
48-
- ArXiV fetcher now checks similarity of entry when using DOI retrieval to avoid false positives. [#2575](https://github.com/JabRef/jabref/issues/2575)
49-
- Sciencedirect/Elsevier fetcher is now able to scrape new HTML structure. [#2576](https://github.com/JabRef/jabref/issues/2576)
50-
- Fixed the synchronization logic of keywords and special fields and vice versa. [#2580](https://github.com/JabRef/jabref/issues/2580)
51-
- We fixed an issue introduced with Version 3.8.2 where executing the `Rename PDFs`-Cleanup operation moved the files to the file directory. [#2526](https://github.com/JabRef/jabref/issues/2526)
52-
- We fixed an issue where the `Move linked files to default file directory`-Cleanup operation did not move the files to the location of the bib-file. [#2454](https://github.com/JabRef/jabref/issues/2454)
53-
- We fixed an issue where executeing `Move file` on a selected file in the `General`-Tab could overwrite an existing file. [#2385](https://github.com/JabRef/jabref/issues/2358)
49+
- ArXiV fetcher now checks similarity of entry when using DOI retrieval to avoid false positives [#2575](https://github.com/JabRef/jabref/issues/2575)
50+
- Sciencedirect/Elsevier fetcher is now able to scrape new HTML structure [#2576](https://github.com/JabRef/jabref/issues/2576)
51+
- Fixed the synchronization logic of keywords and special fields and vice versa [#2580](https://github.com/JabRef/jabref/issues/2580)
52+
- We fixed an issue where the "find unlinked files" functionality threw an error when only one PDF was imported but not assigned to an entry [#2577](https://github.com/JabRef/jabref/issues/2577)
53+
- We fixed issue where escaped braces were incorrectly counted when calculating brace balance in a field [#2561](https://github.com/JabRef/jabref/issues/2561)
54+
- We fixed an issue introduced with Version 3.8.2 where executing the `Rename PDFs`-cleanup operation moved the files to the file directory. [#2526](https://github.com/JabRef/jabref/issues/2526)
55+
- We fixed an issue where the `Move linked files to default file directory`- leanup operation did not move the files to the location of the bib-file. [#2454](https://github.com/JabRef/jabref/issues/2454)
56+
- We fixed an issue where executeing `Move file` on a selected file in the `general`-tab could overwrite an existing file. [#2385](https://github.com/JabRef/jabref/issues/2358)
57+
=======
5458
### Removed
5559

5660

src/main/java/org/jabref/cli/ArgumentProcessor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ private static Optional<ParserResult> importFile(String argument) {
9191
if (address.startsWith("http://") || address.startsWith("https://") || address.startsWith("ftp://")) {
9292
// Download web resource to temporary file
9393
try {
94-
file = new URLDownload(address).downloadToTemporaryFile();
94+
file = new URLDownload(address).toTemporaryFile();
9595
} catch (IOException e) {
9696
System.err.println(Localization.lang("Problem downloading from %1", address) + e.getLocalizedMessage());
9797
return Optional.empty();

src/main/java/org/jabref/gui/externalfiles/DownloadExternalFile.java

+3-5
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import org.jabref.gui.externalfiletype.ExternalFileTypes;
1919
import org.jabref.gui.filelist.FileListEntry;
2020
import org.jabref.gui.filelist.FileListEntryEditor;
21-
import org.jabref.gui.net.MonitoredURLDownload;
2221
import org.jabref.logic.l10n.Localization;
2322
import org.jabref.logic.net.URLDownload;
2423
import org.jabref.logic.util.OS;
@@ -100,12 +99,12 @@ public void download(URL url, final DownloadCallback callback) throws IOExceptio
10099
final File tmp = File.createTempFile("jabref_download", "tmp");
101100
tmp.deleteOnExit();
102101

103-
URLDownload udl = MonitoredURLDownload.buildMonitoredDownload(frame, url);
102+
URLDownload udl = new URLDownload(url);
104103

105104
try {
106105
// TODO: what if this takes long time?
107106
// TODO: stop editor dialog if this results in an error:
108-
mimeType = udl.determineMimeType(); // Read MIME type
107+
mimeType = udl.getMimeType(); // Read MIME type
109108
} catch (IOException ex) {
110109
JOptionPane.showMessageDialog(frame, Localization.lang("Invalid URL") + ": " + ex.getMessage(),
111110
Localization.lang("Download file"), JOptionPane.ERROR_MESSAGE);
@@ -117,7 +116,7 @@ public void download(URL url, final DownloadCallback callback) throws IOExceptio
117116

118117
JabRefExecutorService.INSTANCE.execute(() -> {
119118
try {
120-
udlF.downloadToFile(tmp);
119+
udlF.toFile(tmp.toPath());
121120
} catch (IOException e2) {
122121
dontShowDialog = true;
123122
if ((editor != null) && editor.isVisible()) {
@@ -344,7 +343,6 @@ private String getSuffix(final String link) {
344343
*/
345344
@FunctionalInterface
346345
public interface DownloadCallback {
347-
348346
void downloadComplete(FileListEntry file);
349347
}
350348
}

src/main/java/org/jabref/gui/groups/AutoGroupDialog.java

-264
This file was deleted.

src/main/java/org/jabref/gui/groups/EntryTableTransferHandler.java

+2-5
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import org.jabref.gui.importer.ImportMenuItem;
3333
import org.jabref.gui.importer.actions.OpenDatabaseAction;
3434
import org.jabref.gui.maintable.MainTable;
35-
import org.jabref.gui.net.MonitoredURLDownload;
35+
import org.jabref.logic.net.URLDownload;
3636
import org.jabref.logic.util.io.FileUtil;
3737
import org.jabref.pdfimport.PdfImporter;
3838
import org.jabref.pdfimport.PdfImporter.ImportPdfFilesResult;
@@ -377,10 +377,7 @@ private boolean handleDropTransfer(URL dropLink) throws IOException {
377377
File tmpfile = File.createTempFile("jabrefimport", "");
378378
tmpfile.deleteOnExit();
379379

380-
// System.out.println("Import url: " + dropLink.toString());
381-
// System.out.println("Temp file: "+tmpfile.getAbsolutePath());
382-
383-
MonitoredURLDownload.buildMonitoredDownload(entryTable, dropLink).downloadToFile(tmpfile);
380+
new URLDownload(dropLink).toFile(tmpfile.toPath());
384381

385382
// Import into new if entryTable==null, otherwise into current library:
386383
ImportMenuItem importer = new ImportMenuItem(frame, entryTable == null);

0 commit comments

Comments
 (0)