Add System property ctbrec.server.mode on server startup
This property gets set by the server, so that we know, if we are running in server mode or not
This commit is contained in:
parent
3cf3f2751e
commit
7cc5764461
|
@ -9,6 +9,7 @@ import java.io.FileInputStream;
|
|||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.util.Objects;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -81,4 +82,8 @@ public class Config {
|
|||
Files.createDirectories(configDir.toPath());
|
||||
Files.write(configFile.toPath(), json.getBytes("utf-8"), CREATE, WRITE, TRUNCATE_EXISTING);
|
||||
}
|
||||
|
||||
public boolean isServerMode() {
|
||||
return Objects.equals(System.getProperty("ctbrec.server.mode"), "1");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ public class HttpServer {
|
|||
private Server server = new Server();
|
||||
|
||||
public HttpServer() throws Exception {
|
||||
System.setProperty("ctbrec.server.mode", "1");
|
||||
if(System.getProperty("ctbrec.config") == null) {
|
||||
System.setProperty("ctbrec.config", "server.json");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue