Verified Owner
Top Fields Constructors Methods
org.jabref.http.server.resources

public Class LibraryResource

extends Object
Class Inheritance
Annotations
@Path:libraries/{id}
Imports
java.io.IOException, .InputStream, java.nio.file.Files, java.util.List, .Objects, org.jabref.http.JabrefMediaType, .SrvStateManager, org.jabref.http.dto.BibEntryDTO, org.jabref.http.server.services.ServerUtils, org.jabref.logic.citationstyle.JabRefItemDataProvider, org.jabref.logic.preferences.CliPreferences, org.jabref.model.database.BibDatabase, .BibDatabaseContext, org.jabref.model.entry.BibEntryTypesManager, com.google.gson.Gson, jakarta.inject.Inject, jakarta.ws.rs.GET, .InternalServerErrorException, .Path, .PathParam, .Produces, jakarta.ws.rs.core.MediaType, .Response, .StreamingOutput, org.jspecify.annotations.Nullable, org.slf4j.Logger, .LoggerFactory

Field Summary

Modifier and TypeField and Description
pack-priv BibEntryTypesManager
pack-priv Gson
private static final Logger
pack-priv CliPreferences
pack-priv SrvStateManager

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Response
private @Nullable InputStream
getChocolateBibAsStream()

Returns: a stream to the Chocolate.bib file in the classpath (is null only if the file was moved or there are issues with the classpath)

public String
private BibDatabaseContext
getDatabaseContext(String
- also "demo" for the Chocolate.bib file
id
)

public String

Returns:

specified library in JSON format
getJson
(String
The specified library
id
)

At http://localhost:23119/libraries/{id}

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

entryTypesManagerback to summary
pack-priv BibEntryTypesManager entryTypesManager
Annotations
@Inject
gsonback to summary
pack-priv Gson gson
Annotations
@Inject
LOGGERback to summary
private static final Logger LOGGER
preferencesback to summary
pack-priv CliPreferences preferences
Annotations
@Inject
srvStateManagerback to summary
pack-priv SrvStateManager srvStateManager
Annotations
@Inject

Constructor Detail

LibraryResourceback to summary
public LibraryResource()

Method Detail

getBibtexback to summary
public Response getBibtex(String id)
Annotations
@GET
@Produces:application/x-bibtex
getChocolateBibAsStreamback to summary
private @Nullable InputStream getChocolateBibAsStream()
Returns:@Nullable InputStream

a stream to the Chocolate.bib file in the classpath (is null only if the file was moved or there are issues with the classpath)

getClsItemJsonback to summary
public String getClsItemJson(String id) throws IOException
Annotations
@GET
@Produces:application/x-bibtex-library-csl+json
getDatabaseContextback to summary
private BibDatabaseContext getDatabaseContext(String id) throws IOException
Parameters
id:String

- also "demo" for the Chocolate.bib file

getJsonback to summary
public String getJson(String id) throws IOException

At http://localhost:23119/libraries/{id}

Parameters
id:String

The specified library

Returns:String

specified library in JSON format

Annotations
@GET
@Produces:application/json