-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Fix PDF relativization test #12621
base: main
Are you sure you want to change the base?
Fix PDF relativization test #12621
Changes from 3 commits
d5d1e6e
56a0c5f
21cf853
a8a3817
46bc11f
9e68955
d8d1654
3c5bd14
0fdb00c
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 |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
import java.nio.file.Path; | ||
import java.util.List; | ||
|
||
import org.jabref.logic.FilePreferences; | ||
import org.jabref.logic.importer.Importer; | ||
import org.jabref.logic.importer.ParseException; | ||
import org.jabref.logic.importer.ParserResult; | ||
|
@@ -61,6 +62,18 @@ public ParserResult importDatabase(Path filePath) { | |
} | ||
} | ||
|
||
public ParserResult importDatabase(Path filePath, FilePreferences filePreferences) { | ||
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. Not sure why this is necessary. Shouldn't the caller take care about the absolute path? - Since this method is a) a duplicate of 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... the problem is:
So in this method I leave relativized path in Yeah, something's wrong here |
||
Path readPath = filePreferences.getWorkingDirectory().resolve(filePath); | ||
|
||
try (PDDocument document = new XmpUtilReader().loadWithAutomaticDecryption(readPath)) { | ||
return new ParserResult(importDatabase(filePath, document)); | ||
} catch (EncryptedPdfsNotSupportedException e) { | ||
return ParserResult.fromErrorMessage(Localization.lang("Decryption not supported.")); | ||
} catch (IOException | ParseException exception) { | ||
return ParserResult.fromError(exception); | ||
} | ||
} | ||
|
||
@Override | ||
public StandardFileType getFileType() { | ||
return StandardFileType.PDF; | ||
|
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.
This should be moved down to ´importDatabase`, then I understand it more...
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.
It is in
importDatabase
?