Port distributions and start scripts to Undertow

This commit is contained in:
Max Dor
2019-01-07 02:28:13 +01:00
parent c3ca73f576
commit 54c3014568
11 changed files with 282 additions and 68 deletions

View File

@@ -26,7 +26,9 @@ import org.yaml.snakeyaml.constructor.Constructor;
import org.yaml.snakeyaml.representer.Representer;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Optional;
public class YamlConfigLoader {
@@ -39,4 +41,14 @@ public class YamlConfigLoader {
return GsonUtil.get().fromJson(GsonUtil.get().toJson(o), MxisdConfig.class);
}
public static Optional<MxisdConfig> tryLoadFromFile(String path) {
try {
return Optional.of(loadFromFile(path));
} catch (FileNotFoundException e) {
return Optional.empty();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}