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

public Class GoogleScholar

extends Object
implements FulltextFetcher, PagedSearchBasedFetcher
Class Inheritance
All Implemented Interfaces
org.jabref.logic.importer.PagedSearchBasedFetcher, org.jabref.logic.importer.SearchBasedFetcher, org.jabref.logic.importer.WebFetcher, org.jabref.logic.importer.FulltextFetcher
Imports
java.io.IOException, .Reader, java.net.HttpCookie, .MalformedURLException, .URISyntaxException, .URL, java.util.ArrayList, .Collection, .List, .Optional, java.util.regex.Matcher, .Pattern, org.jabref.logic.help.HelpFile, org.jabref.logic.importer.FetcherException, .FulltextFetcher, .ImportFormatPreferences, .PagedSearchBasedFetcher, .ParserResult, org.jabref.logic.importer.fetcher.transformers.ScholarQueryTransformer, org.jabref.logic.importer.fileformat.BibtexParser, org.jabref.logic.l10n.Localization, org.jabref.logic.net.URLDownload, org.jabref.logic.util.URLUtil, org.jabref.model.entry.BibEntry, org.jabref.model.entry.field.StandardField, org.jabref.model.paging.Page, org.jabref.model.search.query.BaseQueryNode, org.apache.hc.core5.net.URIBuilder, org.jsoup.Jsoup, org.jsoup.nodes.Document, org.jsoup.select.Elements, org.jspecify.annotations.NonNull, org.slf4j.Logger, .LoggerFactory

FulltextFetcher implementation that attempts to find a PDF URL at GoogleScholar.

Search String infos: https://scholar.google.com/intl/en/scholar/help.html#searching

Field Summary

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

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
addHitsFromQuery(List<BibEntry> entryList, String queryURL)

private BibEntry
public Optional<URL>
public Optional<HelpFile>
getHelpPage()

Overrides default org.jabref.logic.importer.WebFetcher.getHelpPage.

Returns the help page for this fetcher.

public String
getName()

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

Returns the localized name of this fetcher.

public TrustLevel
getTrustLevel()

Implements org.jabref.logic.importer.FulltextFetcher.getTrustLevel.

Returns the level of trust for this fetcher.

private boolean
private void
public Page<BibEntry>
private Optional<URL>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BASIC_SEARCH_URLback to summary
private static final String BASIC_SEARCH_URL
importFormatPreferencesback to summary
private final ImportFormatPreferences importFormatPreferences
LOGGERback to summary
private static final Logger LOGGER
NUM_RESULTSback to summary
private static final int NUM_RESULTS

Constructor Detail

GoogleScholarback to summary
public GoogleScholar(@NonNull ImportFormatPreferences importFormatPreferences)

Method Detail

addHitsFromQueryback to summary
private void addHitsFromQuery(List<BibEntry> entryList, String queryURL) throws IOException, FetcherException
downloadEntryback to summary
private BibEntry downloadEntry(String link) throws IOException, FetcherException
findFullTextback to summary
public Optional<URL> findFullText(@NonNull BibEntry entry) throws IOException, FetcherException
Annotations
@Override
getHelpPageback to summary
public Optional<HelpFile> getHelpPage()

Overrides default org.jabref.logic.importer.WebFetcher.getHelpPage.

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

Returns the help page for this fetcher.

Annotations
@Override
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.

Todo

This name is also used for identifying the fetcher in preferences for API keys. Thus, any switch of the language will "remove" API keys.

Annotations
@Override
getTrustLevelback to summary
public TrustLevel getTrustLevel()

Implements 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.

Annotations
@Override
needsCaptchaback to summary
private boolean needsCaptcha(String body)
obtainAndModifyCookieback to summary
private void obtainAndModifyCookie() throws FetcherException
performSearchPagedback to summary
public Page<BibEntry> performSearchPaged(BaseQueryNode queryNode, int pageNumber) throws FetcherException

Implements org.jabref.logic.importer.PagedSearchBasedFetcher.performSearchPaged.

Annotations
@Override
searchback to summary
private Optional<URL> search(String url) throws IOException