Top Description Fields Constructors Methods
org.jabref.logic.importer.fetcher

public Class JstorFetcher

extends Object
implements SearchBasedParserFetcher, FulltextFetcher, IdBasedParserFetcher
Class Inheritance
All Implemented Interfaces
org.jabref.logic.importer.IdBasedParserFetcher, org.jabref.logic.importer.ParserFetcher, org.jabref.logic.importer.IdBasedFetcher, org.jabref.logic.importer.WebFetcher, org.jabref.logic.importer.FulltextFetcher, org.jabref.logic.importer.SearchBasedParserFetcher, org.jabref.logic.importer.SearchBasedFetcher
Imports
java.io.BufferedReader, .IOException, .InputStreamReader, java.net.MalformedURLException, .URISyntaxException, .URL, java.nio.charset.StandardCharsets, java.util.ArrayList, .List, .Optional, java.util.stream.Collectors, org.jabref.logic.importer.FetcherException, .FulltextFetcher, .IdBasedParserFetcher, .ImportFormatPreferences, .ParseException, .Parser, .SearchBasedParserFetcher, org.jabref.logic.importer.fetcher.transformers.JstorQueryTransformer, org.jabref.logic.importer.fileformat.BibtexParser, org.jabref.logic.net.URLDownload, org.jabref.model.entry.BibEntry, org.jabref.model.entry.field.StandardField, org.apache.hc.core5.net.URIBuilder, org.apache.lucene.queryparser.flexible.core.nodes.QueryNode, org.jsoup.Jsoup, org.jsoup.nodes.Document, .Element

Fetcher for jstor.org

Field Summary

Modifier and TypeField and Description
private static final String
private static final String
private final ImportFormatPreferences
private static final String
private static final String

Constructor Summary

AccessConstructor and Description
public
JstorFetcher(ImportFormatPreferences importFormatPreferences)

Method Summary

Modifier and TypeMethod and Description
public void
doPostCleanup(BibEntry
the entry to be cleaned-up
entry
)

Overrides default org.jabref.logic.importer.ParserFetcher.doPostCleanup.

Performs a cleanup of the fetched entry.

public Optional<URL>
findFullText(BibEntry
The Bibtex entry
entry
)

Implements org.jabref.logic.importer.FulltextFetcher.findFullText.

Tries to find a fulltext URL for a given BibTex entry.

public String
getName()

Implements org.jabref.logic.importer.WebFetcher.getName.

Returns the localized name of this fetcher.

public Parser
public TrustLevel
getTrustLevel()

Overrides default org.jabref.logic.importer.FulltextFetcher.getTrustLevel.

Returns the level of trust for this fetcher.

public URL
getUrlForIdentifier(String
the ID
identifier
)

Implements org.jabref.logic.importer.IdBasedParserFetcher.getUrlForIdentifier.

Constructs a URL based on the query.

public URL
getURLForQuery(org.apache.lucene.queryparser.flexible.core.nodes.QueryNode
the root node of the lucene query
luceneQuery
)

Implements org.jabref.logic.importer.SearchBasedParserFetcher.getURLForQuery.

Constructs a URL based on the lucene query.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CITE_HOSTback to summary
private static final String CITE_HOST
HOSTback to summary
private static final String HOST
importFormatPreferencesback to summary
private final ImportFormatPreferences importFormatPreferences
SEARCH_HOSTback to summary
private static final String SEARCH_HOST
URL_QUERY_REGEXback to summary
private static final String URL_QUERY_REGEX

Constructor Detail

JstorFetcherback to summary
public JstorFetcher(ImportFormatPreferences importFormatPreferences)

Method Detail

doPostCleanupback to summary
public void doPostCleanup(BibEntry entry)

Overrides default org.jabref.logic.importer.ParserFetcher.doPostCleanup.

Doc from org.jabref.logic.importer.ParserFetcher.doPostCleanup.

Performs a cleanup of the fetched entry.

Only systematic errors of the fetcher should be corrected here (i.e. if information is consistently contained in the wrong field or the wrong format) but not cosmetic issues which may depend on the user's taste (for example, LateX code vs HTML in the abstract).

Try to reuse existing Formatter for the cleanup. For example, new FieldFormatterCleanup(StandardField.TITLE, new RemoveBracesFormatter()).cleanup(entry);

By default, no cleanup is done.

Parameters
entry:BibEntry

the entry to be cleaned-up

Annotations
@Override
findFullTextback to summary
public Optional<URL> findFullText(BibEntry entry) throws IOException

Implements org.jabref.logic.importer.FulltextFetcher.findFullText.

Doc from org.jabref.logic.importer.FulltextFetcher.findFullText.

Tries to find a fulltext URL for a given BibTex entry.

Parameters
entry:BibEntry

The Bibtex entry

Returns:Optional<URL>

The fulltext PDF URL Optional, if found, or an empty Optional if not found.

Annotations
@Override
Exceptions
IOException:
if an IO operation has failed
getNameback to summary
public String getName()

Implements org.jabref.logic.importer.WebFetcher.getName.

Doc from org.jabref.logic.importer.WebFetcher.getName.

Returns the localized name of this fetcher. The title can be used to display the fetcher in the menu and in the side pane.

Returns:String

the localized name

Annotations
@Override
getParserback to summary
public Parser getParser()

Implements org.jabref.logic.importer.SearchBasedParserFetcher.getParser, org.jabref.logic.importer.IdBasedParserFetcher.getParser.

Doc from org.jabref.logic.importer.SearchBasedParserFetcher.getParser.

Returns the parser used to convert the response to a list of BibEntry.

Annotations
@Override
getTrustLevelback to summary
public TrustLevel getTrustLevel()

Overrides default org.jabref.logic.importer.FulltextFetcher.getTrustLevel.

Doc from org.jabref.logic.importer.FulltextFetcher.getTrustLevel.

Returns the level of trust for this fetcher. We distinguish between publishers and meta search engines for example.

Returns:TrustLevel

The trust level of the fetcher, the higher the better

Annotations
@Override
getUrlForIdentifierback to summary
public URL getUrlForIdentifier(String identifier) throws FetcherException

Implements org.jabref.logic.importer.IdBasedParserFetcher.getUrlForIdentifier.

Doc from org.jabref.logic.importer.IdBasedParserFetcher.getUrlForIdentifier.

Constructs a URL based on the query.

Parameters
identifier:String

the ID

Annotations
@Override
getURLForQueryback to summary
public URL getURLForQuery(org.apache.lucene.queryparser.flexible.core.nodes.QueryNode luceneQuery) throws URISyntaxException, MalformedURLException, FetcherException

Implements org.jabref.logic.importer.SearchBasedParserFetcher.getURLForQuery.

Doc from org.jabref.logic.importer.SearchBasedParserFetcher.getURLForQuery.

Constructs a URL based on the lucene query.

Parameters
luceneQuery:org.apache.lucene.queryparser.flexible.core.nodes.QueryNode

the root node of the lucene query

Annotations
@Override