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

public Class FulltextFetchers

extends Object
Class Inheritance
Imports
java.io.IOException, java.net.MalformedURLException, java.util.Comparator, .HashSet, .List, .Map, .Optional, .Set, java.util.concurrent.Callable, .CancellationException, .ExecutionException, .Future, .TimeUnit, java.util.function.BiPredicate, org.jabref.logic.net.URLDownload, org.jabref.logic.util.HeadlessExecutorService, org.jabref.model.entry.BibEntry, org.jabref.model.entry.field.StandardField, org.jabref.model.entry.identifier.DOI, com.google.common.annotations.VisibleForTesting, org.slf4j.Logger, .LoggerFactory

Utility class for trying to resolve URLs to full-text PDF for articles.

Combines multiple FulltextFetchers together. Each fetcher is invoked, the "best" result (sorted by the fetcher trust level) is returned.

Field Summary

Modifier and TypeField and Description
private static final int
private final Set<FulltextFetcher>
private final ImporterPreferences
private final BiPredicate<String, Map<String, String>>
private static final Logger

Constructor Summary

AccessConstructor and Description
public
FulltextFetchers(ImportFormatPreferences importFormatPreferences, ImporterPreferences importerPreferences)

pack-priv
private
FulltextFetchers(Set<FulltextFetcher> fetchers, ImporterPreferences importerPreferences)

Method Summary

Modifier and TypeMethod and Description
private void
public Optional<FetcherResult>
private Callable<Optional<FetcherResult>>
private List<Callable<Optional<FetcherResult>>>
private static Optional<FetcherResult>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

FETCHER_TIMEOUTback to summary
private static final int FETCHER_TIMEOUT
fetchersback to summary
private final Set<FulltextFetcher> fetchers
importerPreferencesback to summary
private final ImporterPreferences importerPreferences
isPDFback to summary
private final BiPredicate<String, Map<String, String>> isPDF
LOGGERback to summary
private static final Logger LOGGER

Constructor Detail

FulltextFetchersback to summary
public FulltextFetchers(ImportFormatPreferences importFormatPreferences, ImporterPreferences importerPreferences)
FulltextFetchersback to summary
pack-priv FulltextFetchers(Set<FulltextFetcher> fetchers)
Annotations
@VisibleForTesting
FulltextFetchersback to summary
private FulltextFetchers(Set<FulltextFetcher> fetchers, ImporterPreferences importerPreferences)

Method Detail

findDoiForEntryback to summary
private void findDoiForEntry(BibEntry clonedEntry)
findFullTextPDFback to summary
public Optional<FetcherResult> findFullTextPDF(BibEntry entry)
getCallableback to summary
private Callable<Optional<FetcherResult>> getCallable(BibEntry entry, FulltextFetcher fetcher)
getCallablesback to summary
private List<Callable<Optional<FetcherResult>>> getCallables(BibEntry entry, Set<FulltextFetcher> fetchers)
getResultsback to summary
private static Optional<FetcherResult> getResults(Future<Optional<FetcherResult>> future)