| doLinkAssociatedFiles | back to summary
|
|---|
| private void doLinkAssociatedFiles(BibEntry entry, BiConsumer<List<LinkedFile>, BibEntry> onAddLinkedFile, AutoSetFileLinksUtil.LinkFilesResult result) Source of associated not linked files:
- Part A. match file name with CitationKey, (START, EXACT, REGEX) configured by user
- Part B. match file name with broken linked file names, currently silently happen
The auto-link process:
- Prolog: we only consider the file with a unique name
- if a file's name is found multiple times in Part A, we do not consider it in Step 1
- if a file's name is found multiple times in Part B, we do not consider it in Step 2
- Step 1. try to auto link each broken linked file with Part A at first. For unlinked files left in Part A, if no
linked file with same name exists, add them
- why
add: Part A are found mainly by CitationKey, which has strong connection to the entry, so we are
confident that we should add them automatically
- Step 2. try to auto link each broken linked file with Part B.
- how about
unlinked files left in Part B: those files have the same name with one broken linked file
but different extension. We skip those files.
- one trick: we accumulate Part B after Step 1, so Part A does not affect those broken linked files we use
to query Part B
|
| findAssociatedNotLinkedFiles | back to summary
|
|---|
| public Collection<LinkedFile> findAssociatedNotLinkedFiles(BibEntry entry) throws IOException Scans for missing files which should be linked to the given entry.
Related: org.jabref.gui.externalfiles.UnlinkedFilesCrawler for scanning files missing at all entries
NOTE:
- This method does not check if the file is already linked to another entry.
- This method does not guarantee how the returned files are ordered. Order by how they appear in BibEntry does
not work since findAssociatedFilesByBrokenLinkedFile may return multiple files (with the same name) for one
broken linked file in the entry.
|
| findAssociatedNotLinkedFilesWithFinder | back to summary
|
|---|
| public Collection<LinkedFile> findAssociatedNotLinkedFilesWithFinder(BibEntry entry, FileFinder finder, List<String> extensions) throws IOException
|
| findAssociatedNotLinkedFilesWithUniqueName | back to summary
|
|---|
| private Map<String, LinkedFile> findAssociatedNotLinkedFilesWithUniqueName(BibEntry entry, FileFinder finder) throws IOException
|
| isBrokenLinkedFile | back to summary
|
|---|
| private boolean isBrokenLinkedFile(LinkedFile file)
|