[infrastructure] add external null-annotations (#8848)

Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
This commit is contained in:
J-N-K
2020-10-31 00:29:03 +01:00
committed by GitHub
parent 47d05055db
commit bd664ff0c8
162 changed files with 933 additions and 575 deletions

View File

@@ -36,7 +36,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* The {@link LogReaderHandler} is responsible for handling commands, which are
* The {@link LogHandler} is responsible for handling commands, which are
* sent to one of the channels.
*
* @author Miika Jukka - Initial contribution
@@ -80,10 +80,15 @@ public class LogHandler extends BaseThingHandler implements FileReaderListener {
@Override
public void initialize() {
configuration = getConfigAs(LogReaderConfiguration.class);
String logDir = System.getProperty("openhab.logdir");
if (logDir == null) {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR,
"Cannot determine system log directory.");
return;
}
configuration.filePath = configuration.filePath.replaceFirst("\\$\\{OPENHAB_LOGDIR\\}",
System.getProperty("openhab.logdir"));
configuration = getConfigAs(LogReaderConfiguration.class);
configuration.filePath = configuration.filePath.replaceFirst("\\$\\{OPENHAB_LOGDIR\\}", logDir);
logger.debug("Using configuration: {}", configuration);