Skip to content

Commit

Permalink
JabRef#4913 Bug - Downloads from the arXiv are marked as HTML files i…
Browse files Browse the repository at this point in the history
…nstead of PDF

may have found where to edit
  • Loading branch information
jabesse committed Apr 25, 2019
1 parent 5da1ee2 commit 96807fd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/logic/importer/fetcher/ArXiv.java
Original file line number Diff line number Diff line change
Expand Up @@ -334,14 +334,14 @@ public ArXivEntry(Node item) {
if (linkTitle.equals(Optional.of("pdf"))) {
pdfUrlParsed = XMLUtil.getAttributeContent(linkNode, "href").map(url -> {
try {
//#4913 bug
return new URL(url);
} catch (MalformedURLException e) {
return null;
}
});
}
}
//#4913 bug
pdfUrl = pdfUrlParsed;

// Associated DOI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ public void findFullTextByDOI() throws IOException {
assertEquals(Optional.of(new URL("http://arxiv.org/pdf/cond-mat/0406246v1")), finder.findFullText(entry));
}

@Test
public void givenTestBibentry_whenfindFullText_thenFindFullTextByDOIWithPDFFileTypeSuffixAdded() throws IOException {
entry.setField(FieldName.DOI, "10.1529/biophysj.104.047340");
entry.setField(FieldName.TITLE, "Pause Point Spectra in DNA Constant-Force Unzipping");

assertEquals(Optional.of(new URL("http://arxiv.org/pdf/cond-mat/0406246v1.pdf")), finder.findFullText(entry));
}

@Test
public void findFullTextByEprint() throws IOException {
entry.setField("eprint", "1603.06570");
Expand Down

0 comments on commit 96807fd

Please sign in to comment.