second commit 20/01/2026

This commit is contained in:
2026-01-20 17:02:55 +07:00
parent 61f22936c7
commit 38f3fd54b7
15 changed files with 409 additions and 6 deletions

View File

@@ -16,6 +16,12 @@ class Config {
var WebPort : Int
get() = prop.getProperty("webport").toInt()
set(value) {prop.setProperty("webport", value.toString())}
var WebUsername : String
get() = prop.getProperty("webusername")
set(value) {prop.setProperty("webusername", value)}
var WebPassword : String
get() = prop.getProperty("webpassword")
set(value) {prop.setProperty("webpassword", value)}
var ActiveMQ_BrokerURL : String
get() = prop.getProperty("activemq_brokerurl")
set(value) {prop.setProperty("activemq_brokerurl", value)}
@@ -61,6 +67,8 @@ class Config {
if (Files.isRegularFile(Path(filename))){
prop.load(FileInputStream(filename))
if (!prop.contains("webport")) throw Exception("Invalid config file: missing 'webport'")
if (!prop.contains("webusername")) throw Exception("Invalid config file: missing 'webusername'")
if (!prop.contains("webpassword")) throw Exception("Invalid config file: missing 'webpassword'")
if (!prop.contains("activemq_brokerurl")) throw Exception("Invalid config file: missing 'activemq_brokerurl'")
if (!prop.contains("activemq_username")) throw Exception("Invalid config file: missing 'activemq_username'")
if (!prop.contains("activemq_password")) throw Exception("Invalid config file: missing 'activemq_password'")
@@ -103,6 +111,8 @@ class Config {
fun CreateDefault(){
prop.clear()
prop.setProperty("webport", "7000")
prop.setProperty("webusername", "admin")
prop.setProperty("webpassword", "admin")
prop.setProperty("activemq_brokerurl", "tcp://localhost:61616")
prop.setProperty("activemq_username", "admin")
prop.setProperty("activemq_password", "admin")