Port distributions and start scripts to Undertow
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user