-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
/
Copy pathExternalFilesContentImporter.java
29 lines (22 loc) · 1.17 KB
/
ExternalFilesContentImporter.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package org.jabref.logic.externalfiles;
import java.io.IOException;
import java.nio.file.Path;
import org.jabref.logic.FilePreferences;
import org.jabref.logic.importer.ImportFormatPreferences;
import org.jabref.logic.importer.OpenDatabase;
import org.jabref.logic.importer.ParserResult;
import org.jabref.logic.importer.fileformat.PdfMergeMetadataImporter;
import org.jabref.model.database.BibDatabaseContext;
import org.jabref.model.util.FileUpdateMonitor;
public class ExternalFilesContentImporter {
private final ImportFormatPreferences importFormatPreferences;
public ExternalFilesContentImporter(ImportFormatPreferences importFormatPreferences) {
this.importFormatPreferences = importFormatPreferences;
}
public ParserResult importPDFContent(Path file, BibDatabaseContext context, FilePreferences filePreferences) {
return new PdfMergeMetadataImporter(importFormatPreferences).importDatabase(file, context, filePreferences);
}
public ParserResult importFromBibFile(Path bibFile, FileUpdateMonitor fileUpdateMonitor) throws IOException {
return OpenDatabase.loadDatabase(bibFile, importFormatPreferences, fileUpdateMonitor);
}
}