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.ArrayList, .Collections, .HashSet, .List, .Objects, .Optional, .Set, java.util.function.BiPredicate, java.util.stream.Collectors, .Stream, org.jabref.logic.citationkeypattern.CitationKeyGenerator, org.jabref.model.entry.BibEntry, org.jabref.model.strings.StringUtil

Field Summary

Modifier and TypeField and Description
private final boolean

Constructor Summary

AccessConstructor and Description
pack-priv
CitationKeyBasedFileFinder(boolean exactKeyOnly)

Method Summary

Modifier and TypeMethod and Description
public List<Path>
findAssociatedFiles(BibEntry
The entry to search files for.
entry
,
List<Path>
The root directories to search.
directories
,
List<String>
The extensions that are acceptable.
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 Set<Path>
findFilesByExtension(List<Path> directories, List<String> extensions)

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

Constructor Detail

CitationKeyBasedFileFinderback to summary
pack-priv CitationKeyBasedFileFinder(boolean exactKeyOnly)

Method Detail

findAssociatedFilesback to summary
public List<Path> findAssociatedFiles(BibEntry entry, 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.

Parameters
entry:BibEntry

The entry to search files for.

directories:List<Path>

The root directories to search.

extensions:List<String>

The extensions that are acceptable.

Annotations
@Override
findFilesByExtensionback to summary
private Set<Path> findFilesByExtension(List<Path> directories, List<String> extensions) 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)