Verified Owner
Top Fields Constructors Methods
org.jabref.logic.util.io

pack-priv Class CitationKeyBasedFileFinder

extends Object
implements FileFinder
Class Inheritance
All Implemented Interfaces
org.jabref.logic.util.io.FileFinder
Imports
java.io.IOException, .UncheckedIOException, java.nio.file.FileVisitOption, .Files, .Path, java.nio.file.attribute.BasicFileAttributes, java.util.Collection, .List, .Optional, .SortedSet, .TreeSet, java.util.function.BiPredicate, .Function, java.util.stream.Collectors, .Stream, org.jabref.logic.citationkeypattern.CitationKeyGenerator, org.jabref.logic.util.strings.StringUtil, org.jabref.model.entry.BibEntry, org.jspecify.annotations.NonNull, org.slf4j.Logger, .LoggerFactory

Field Summary

Modifier and TypeField and Description
private final boolean
private static final Logger

Constructor Summary

AccessConstructor and Description
pack-priv
CitationKeyBasedFileFinder(boolean exactKeyOnly)

Method Summary

Modifier and TypeMethod and Description
public List<Path>
findAssociatedFiles(@NonNull BibEntry entry, @NonNull List<Path> directories, List<String> extensions)

Implements org.jabref.logic.util.io.FileFinder.findAssociatedFiles.

Finds all files in the given directories that are probably associated with the given entries and have one of the passed extensions.

private SortedSet<Path>
findFilesByExtension(List<Path> directories, @NonNull Collection<String> extensions, Function<Path, Boolean> filteringFunction)

Returns a list of all files in the given directories which have one of the given extension.

private boolean
matches(String filename, String citeKey)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

exactKeyOnlyback to summary
private final boolean exactKeyOnly
LOGGERback to summary
private static final Logger LOGGER

Constructor Detail

CitationKeyBasedFileFinderback to summary
pack-priv CitationKeyBasedFileFinder(boolean exactKeyOnly)

Method Detail

findAssociatedFilesback to summary
public List<Path> findAssociatedFiles(@NonNull BibEntry entry, @NonNull List<Path> directories, List<String> extensions) throws IOException

Implements org.jabref.logic.util.io.FileFinder.findAssociatedFiles.

Doc from org.jabref.logic.util.io.FileFinder.findAssociatedFiles.

Finds all files in the given directories that are probably associated with the given entries and have one of the passed extensions.

Annotations
@Override
findFilesByExtensionback to summary
private SortedSet<Path> findFilesByExtension(List<Path> directories, @NonNull Collection<String> extensions, Function<Path, Boolean> filteringFunction) throws IOException

Returns a list of all files in the given directories which have one of the given extension.

matchesback to summary
private boolean matches(String filename, String citeKey)