commit | 5f1739107b27e4cacef3a8c564a774bd331d4ac5 | [log] [tgz] |
---|---|---|
author | Thomas Draebing <thomas.draebing@sap.com> | Mon Apr 15 10:37:21 2019 +0200 |
committer | Thomas Draebing <thomas.draebing@sap.com> | Thu Apr 18 10:33:53 2019 +0200 |
tree | eeceed17ed39cc081927c59b6a26a07cdcf86d5c | |
parent | 54d095b24ffc3625fa4ec05ae71557077ca3acbc [diff] |
Simplify cache-directory creation This change adapts the creation of the directory containing the websession-cache to the method used in the HA-plugin, which simplifies the code. Change-Id: I366fe42f0382e4f682c95da38ffb4edc8b5ba079
diff --git a/src/main/java/com/googlesource/gerrit/plugins/websession/flatfile/FlatFileWebSessionCache.java b/src/main/java/com/googlesource/gerrit/plugins/websession/flatfile/FlatFileWebSessionCache.java index 55c3230..fc6ee9b 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/websession/flatfile/FlatFileWebSessionCache.java +++ b/src/main/java/com/googlesource/gerrit/plugins/websession/flatfile/FlatFileWebSessionCache.java
@@ -78,16 +78,9 @@ private final Path dir; @Inject - public FlatFileWebSessionCache(@WebSessionDir Path dir) { + public FlatFileWebSessionCache(@WebSessionDir Path dir) throws IOException { this.dir = dir; - if (Files.notExists(dir)) { - log.info(dir + " not found. Creating it."); - try { - Files.createDirectory(dir); - } catch (IOException e) { - log.error("Unable to create directory " + dir, e); - } - } + Files.createDirectories(dir); } @Override