From aea9f2dbdeea103ca335af10b9c6d927df2dd7a0 Mon Sep 17 00:00:00 2001 From: Siedlerchr Date: Thu, 17 Mar 2022 18:03:40 +0100 Subject: [PATCH] Fix missing search index dir Fixes #8579 --- CHANGELOG.md | 3 ++- src/main/java/org/jabref/gui/JabRefMain.java | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 343d5ab17d5..7d9a8f8bb86 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,7 +24,8 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve ### Fixed -- We fixed an issue wehre long article numbers in the `pages` field would cause an exception and preventing the citation style to display [#8381](https://github.com/JabRef/jabref/issues/8381), [citeproc-java](https://github.com/michel-kraemer/citeproc-java/issues/114) +- We fixed an issue where JabRef could not start due to a missing directory for the fulltex index [#8579](https://github.com/JabRef/jabref/issues/8579) +- We fixed an issue where long article numbers in the `pages` field would cause an exception and preventing the citation style to display [#8381](https://github.com/JabRef/jabref/issues/8381), [citeproc-java](https://github.com/michel-kraemer/citeproc-java/issues/114) - We fixed an issue where online links in the file field were not detected correctly and could produce an exception [#8150](https://github.com/JabRef/jabref/issues/8510) - We fixed an issue where an exception could occur when saving the preferences [#7614](https://github.com/JabRef/jabref/issues/7614) - We fixed an issue where "Copy DOI url" in the right-click menu of the Entry List would just copy the DOI and not the DOI url. [#8389](https://github.com/JabRef/jabref/issues/8389) diff --git a/src/main/java/org/jabref/gui/JabRefMain.java b/src/main/java/org/jabref/gui/JabRefMain.java index 084356f5fe3..b0fcd7fe22c 100644 --- a/src/main/java/org/jabref/gui/JabRefMain.java +++ b/src/main/java/org/jabref/gui/JabRefMain.java @@ -153,6 +153,12 @@ private static void clearOldSearchIndices() { Path currentIndexPath = BibDatabaseContext.getFulltextIndexBasePath(); Path appData = currentIndexPath.getParent(); + try { + Files.createDirectories(currentIndexPath); + } catch (IOException e) { + LOGGER.error("Could not create index directory {}", appData, e); + } + try (DirectoryStream stream = Files.newDirectoryStream(appData)) { for (Path path : stream) { if (Files.isDirectory(path) && !path.equals(currentIndexPath)) { @@ -161,7 +167,6 @@ private static void clearOldSearchIndices() { .sorted(Comparator.reverseOrder()) .map(Path::toFile) .forEach(File::delete); - } } } catch (IOException e) {