Skip to content

Commit cc6f3fd

Browse files
Vladimir Kotalahornace
authored andcommitted
check source and data root
1 parent 476443e commit cc6f3fd

File tree

1 file changed

+8
-0
lines changed
  • opengrok-indexer/src/main/java/org/opengrok/indexer/index

1 file changed

+8
-0
lines changed

opengrok-indexer/src/main/java/org/opengrok/indexer/index/Indexer.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -870,6 +870,14 @@ private static void checkConfiguration() {
870870
if (repositories.size() > 0 && !cfg.isHistoryEnabled()) {
871871
die("Repositories were specified; history is off however");
872872
}
873+
874+
if (! new File(cfg.getSourceRoot()).canRead()) {
875+
die("Source root '" + cfg.getSourceRoot() + "' must be readable");
876+
}
877+
878+
if (! new File(cfg.getDataRoot()).canWrite()) {
879+
die("Data root '" + cfg.getDataRoot() + "' must be writable");
880+
}
873881
}
874882

875883
private static void die(String message) {

0 commit comments

Comments
 (0)