Skip to content

Commit

Permalink
Fix missing search index dir (#8581)
Browse files Browse the repository at this point in the history
Fixes #8579
  • Loading branch information
Siedlerchr authored Mar 17, 2022
1 parent bc7d227 commit 6ebb56f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/org/jabref/gui/JabRefMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<Path> stream = Files.newDirectoryStream(appData)) {
for (Path path : stream) {
if (Files.isDirectory(path) && !path.equals(currentIndexPath)) {
Expand All @@ -161,7 +167,6 @@ private static void clearOldSearchIndices() {
.sorted(Comparator.reverseOrder())
.map(Path::toFile)
.forEach(File::delete);

}
}
} catch (IOException e) {
Expand Down

0 comments on commit 6ebb56f

Please sign in to comment.