use of com.djrapitops.plan.settings.config.ConfigReader in project Plan by plan-player-analytics.
the class ServerSettingsManager method updateConfigInDB.
private void updateConfigInDB(File file) {
if (!file.exists()) {
return;
}
Database database = dbSystem.getDatabase();
Optional<ServerUUID> serverUUID = serverInfo.getServerUUIDSafe();
if (!serverUUID.isPresent()) {
return;
}
try (ConfigReader reader = new ConfigReader(file.toPath())) {
Config read = reader.read();
database.executeTransaction(new StoreConfigTransaction(serverUUID.get(), read, file.lastModified()));
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
use of com.djrapitops.plan.settings.config.ConfigReader in project Plan by plan-player-analytics.
the class ThemeConfig method getDefaults.
private static ConfigNode getDefaults(PlanFiles files, PlanConfig config, PluginLogger logger) {
String fileName = config.get(DisplaySettings.THEME);
String fileLocation = getFileLocation(fileName);
try (ConfigReader reader = new ConfigReader(files.getResourceFromJar(fileLocation).asInputStream())) {
return reader.read();
} catch (IOException e) {
logger.error("Could not find theme " + fileLocation + ". Attempting to use default.");
return new ConfigNode(null, null, null);
}
}
use of com.djrapitops.plan.settings.config.ConfigReader in project Plan by plan-player-analytics.
the class ServerFileLoader method prepare.
public void prepare() throws IOException {
read();
try (ConfigReader reader = new ConfigReader(files.getResourceFromJar("DefaultServerInfoFile.yml").asInputStream())) {
copyMissing(reader.read());
}
save();
prepared = true;
}
Aggregations