Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into moveFileDir
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Siedlerchr committed Mar 2, 2017
2 parents 76884c2 + 48f5293 commit c0f60e0
Show file tree
Hide file tree
Showing 66 changed files with 1,164 additions and 1,274 deletions.
16 changes: 10 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- Redesigned group panel.
- Number of matched entries is always shown.
- The background color of the hit counter signals whether the group contains all/any of the entries selected in the main table.
- Added a possibility to filter the groups panel [#1904](https://github.com/JabRef/jabref/issues/1904)
- Removed edit mode.
- Redesigned about dialog.
- Redesigned key bindings dialog.
Expand Down Expand Up @@ -45,12 +46,15 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- The field `issue` is now always exported to the corresponding `issue` field in MS-Office XML.
- 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)
- We fixed the import of MS-Office XML files, when the `month` field contained an invalid value.
- ArXiV fetcher now checks similarity of entry when using DOI retrieval to avoid false positives. [#2575](https://github.com/JabRef/jabref/issues/2575)
- Sciencedirect/Elsevier fetcher is now able to scrape new HTML structure. [#2576](https://github.com/JabRef/jabref/issues/2576)
- Fixed the synchronization logic of keywords and special fields and vice versa. [#2580](https://github.com/JabRef/jabref/issues/2580)
- 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)
- 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)
- 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)
- ArXiV fetcher now checks similarity of entry when using DOI retrieval to avoid false positives [#2575](https://github.com/JabRef/jabref/issues/2575)
- Sciencedirect/Elsevier fetcher is now able to scrape new HTML structure [#2576](https://github.com/JabRef/jabref/issues/2576)
- Fixed the synchronization logic of keywords and special fields and vice versa [#2580](https://github.com/JabRef/jabref/issues/2580)
- 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)
- We fixed issue where escaped braces were incorrectly counted when calculating brace balance in a field [#2561](https://github.com/JabRef/jabref/issues/2561)
- 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)
- 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)
- 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)
=======
### Removed


Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/cli/ArgumentProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ private static Optional<ParserResult> importFile(String argument) {
if (address.startsWith("http://") || address.startsWith("https://") || address.startsWith("ftp://")) {
// Download web resource to temporary file
try {
file = new URLDownload(address).downloadToTemporaryFile();
file = new URLDownload(address).toTemporaryFile();
} catch (IOException e) {
System.err.println(Localization.lang("Problem downloading from %1", address) + e.getLocalizedMessage());
return Optional.empty();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import org.jabref.gui.externalfiletype.ExternalFileTypes;
import org.jabref.gui.filelist.FileListEntry;
import org.jabref.gui.filelist.FileListEntryEditor;
import org.jabref.gui.net.MonitoredURLDownload;
import org.jabref.logic.l10n.Localization;
import org.jabref.logic.net.URLDownload;
import org.jabref.logic.util.OS;
Expand Down Expand Up @@ -100,12 +99,12 @@ public void download(URL url, final DownloadCallback callback) throws IOExceptio
final File tmp = File.createTempFile("jabref_download", "tmp");
tmp.deleteOnExit();

URLDownload udl = MonitoredURLDownload.buildMonitoredDownload(frame, url);
URLDownload udl = new URLDownload(url);

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

JabRefExecutorService.INSTANCE.execute(() -> {
try {
udlF.downloadToFile(tmp);
udlF.toFile(tmp.toPath());
} catch (IOException e2) {
dontShowDialog = true;
if ((editor != null) && editor.isVisible()) {
Expand Down Expand Up @@ -344,7 +343,6 @@ private String getSuffix(final String link) {
*/
@FunctionalInterface
public interface DownloadCallback {

void downloadComplete(FileListEntry file);
}
}
264 changes: 0 additions & 264 deletions src/main/java/org/jabref/gui/groups/AutoGroupDialog.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import org.jabref.gui.importer.ImportMenuItem;
import org.jabref.gui.importer.actions.OpenDatabaseAction;
import org.jabref.gui.maintable.MainTable;
import org.jabref.gui.net.MonitoredURLDownload;
import org.jabref.logic.net.URLDownload;
import org.jabref.logic.util.io.FileUtil;
import org.jabref.pdfimport.PdfImporter;
import org.jabref.pdfimport.PdfImporter.ImportPdfFilesResult;
Expand Down Expand Up @@ -377,10 +377,7 @@ private boolean handleDropTransfer(URL dropLink) throws IOException {
File tmpfile = File.createTempFile("jabrefimport", "");
tmpfile.deleteOnExit();

// System.out.println("Import url: " + dropLink.toString());
// System.out.println("Temp file: "+tmpfile.getAbsolutePath());

MonitoredURLDownload.buildMonitoredDownload(entryTable, dropLink).downloadToFile(tmpfile);
new URLDownload(dropLink).toFile(tmpfile.toPath());

// Import into new if entryTable==null, otherwise into current library:
ImportMenuItem importer = new ImportMenuItem(frame, entryTable == null);
Expand Down
Loading

0 comments on commit c0f60e0

Please sign in to comment.