do not auto-configure path event directory

This commit is contained in:
Jörg Prante 2024-03-27 17:23:19 +01:00
parent 2eaab6dd4d
commit fb1a08f9d8

View file

@ -18,6 +18,7 @@ import java.util.Collection;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects;
import java.util.concurrent.ExecutorService; import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future; import java.util.concurrent.Future;
import java.util.logging.Level; import java.util.logging.Level;
@ -49,7 +50,8 @@ public class PathEventManagerService extends AbstractEventManagerService impleme
String name = entry.getKey(); String name = entry.getKey();
Settings definition = entry.getValue(); Settings definition = entry.getValue();
if (definition.getAsBoolean("enabled", true)) { if (definition.getAsBoolean("enabled", true)) {
Path path = Paths.get(definition.get("path", "/var/tmp/" + name)); String pathName = Objects.requireNonNull(definition.get("path"), "path must not be null");
Path path = Paths.get(pathName);
TimeValue lifetime = definition.getAsTime("lifetime", TimeValue.timeValueHours(72)); TimeValue lifetime = definition.getAsTime("lifetime", TimeValue.timeValueHours(72));
String eventType = definition.get("type", "path"); String eventType = definition.get("type", "path");
createQueue(name, path); createQueue(name, path);