-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Dublin Core #3710
[WIP] Dublin Core #3710
Changes from 1 commit
282f066
b88c1c8
3e0dd1d
20d4c8a
c593f2b
cddba9d
06fbcba
69b712f
ae26532
9cc529f
366aeed
8c2b446
79f1134
be7db0f
d32e8d7
d5dd993
523a1f3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,9 +74,9 @@ public void setUp() { | |
public void testReadArticleDublinCoreReadXMP() throws IOException, URISyntaxException, ParseException { | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove empty line There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
Path path = Paths.get(XMPUtilShared.class.getResource("/org/jabref/logic/xmp/article_dublinCore.pdf").toURI()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does one really need the absolute path here? I thought, just the filename is enough, because it looks up in the current directory (where the resources are mirrored to). If this is the package org.jabref.logic.xmp, it should "just work". There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. I do not need the absolute path 👍 |
||
Optional<XMPMetadata> meta = XMPUtilReader.readRawXMP(path); | ||
Optional<List<XMPMetadata>> meta = XMPUtilReader.readRawXMP(path); | ||
|
||
DublinCoreSchema dcSchema = meta.get().getDublinCoreSchema(); | ||
DublinCoreSchema dcSchema = meta.get().get(0).getDublinCoreSchema(); | ||
DublinCoreExtractor dcExtractor = new DublinCoreExtractor(dcSchema, xmpPreferences, new BibEntry()); | ||
Optional<BibEntry> entry = dcExtractor.extractBibtexEntry(); | ||
String bibString = Resources.toString(XMPUtilShared.class.getResource("/org/jabref/logic/xmp/article_dublinCore.bib"), StandardCharsets.UTF_8); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A
List
should always be non-null and thus it does not makes sense to wrap anOptional
around it. The not-present case corresponds to an empty list, which you can check usingisEmpty()
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this comment. Done 👍