Verified Owner
Top Description Fields Constructors Methods
org.jabref.logic.shared

public Class SharedDatabaseExport

extends Object
Class Inheritance
Annotations
@NullMarked
Imports
java.io.IOException, .Writer, java.nio.charset.StandardCharsets, java.nio.file.Files, .Path, java.sql.SQLException, java.util.Map, org.jabref.logic.exporter.BibDatabaseWriter, org.jabref.logic.importer.ParseException, org.jabref.logic.importer.util.MetaDataParser, org.jabref.logic.preferences.CliPreferences, org.jabref.logic.shared.exception.InvalidDBMSConnectionPropertiesException, org.jabref.model.database.BibDatabase, .BibDatabaseContext, org.jabref.model.metadata.MetaData, org.jabref.model.util.DummyFileUpdateMonitor, org.jspecify.annotations.NullMarked, org.slf4j.Logger, .LoggerFactory

Read-only export of a shared SQL library into a plain .bib file, without a DBMSSynchronizer and without a notification listener. This is what gives command line tools access to a shared database: they read the exported file like any other library.

Field Summary

Modifier and TypeField and Description
private static final Logger

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static MetaData
parseMetaData(Map<String, String> sharedMetaData, CliPreferences preferences)

private static BibDatabaseContext
public static Path

Returns:

the path of the temporary .bib file
pullToTemporaryBib
(DBMSConnectionUrl url, CliPreferences preferences)

Connects to the shared database, writes its entries and meta data to a temporary file, and disconnects again.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

LOGGERback to summary
private static final Logger LOGGER

Constructor Detail

SharedDatabaseExportback to summary
private SharedDatabaseExport()

Method Detail

parseMetaDataback to summary
private static MetaData parseMetaData(Map<String, String> sharedMetaData, CliPreferences preferences)
pullback to summary
private static BibDatabaseContext pull(DBMSConnectionUrl url, CliPreferences preferences) throws SQLException, InvalidDBMSConnectionPropertiesException, DatabaseNotSupportedException
pullToTemporaryBibback to summary
public static Path pullToTemporaryBib(DBMSConnectionUrl url, CliPreferences preferences) throws SQLException, InvalidDBMSConnectionPropertiesException, DatabaseNotSupportedException, IOException

Connects to the shared database, writes its entries and meta data to a temporary file, and disconnects again. The file is deleted when the JVM exits.

Returns:Path

the path of the temporary .bib file

Exceptions
DatabaseNotSupportedException:
if the database is not a JabRef shared database