提交 85acb30b authored 作者: Thomas Mueller's avatar Thomas Mueller

H2 Console: webAllowOthers and webSSL were swapped if they didn't exist in the…

H2 Console: webAllowOthers and webSSL were swapped if they didn't exist in the properties file. Issue 244.
上级 a7d663ef
......@@ -18,7 +18,8 @@ Change Log
<h1>Change Log</h1>
<h2>Next Version (unreleased)</h2>
<ul><li>When the system property h2.lobInDatabase is set, CREATE TABLE ... AS SELECT
<ul><li>H2 Console: webAllowOthers and webSSL were swapped if they didn't exist in the properties file. Issue 244.
</li><li>When the system property h2.lobInDatabase is set, CREATE TABLE ... AS SELECT
with a LOB column did not always work.
</li><li>Some system properties are not supported any longer, because they can
already be set in the database URL. Those settings are:
......
......@@ -348,7 +348,7 @@ public class WebApp {
boolean ssl = Boolean.valueOf((String) attributes.get("ssl")).booleanValue();
prop.setProperty("webSSL", String.valueOf(ssl));
server.setSSL(ssl);
server.saveSettings(prop);
server.saveProperties(prop);
} catch (Exception e) {
trace(e.toString());
}
......@@ -1652,7 +1652,7 @@ public class WebApp {
info.user = attributes.getProperty("user", "");
server.updateSetting(info);
attributes.put("setting", info.name);
server.saveSettings(null);
server.saveProperties(null);
return "index.do";
}
......@@ -1735,7 +1735,7 @@ public class WebApp {
if (settings.size() > 0) {
attributes.put("setting", settings.get(0));
}
server.saveSettings(null);
server.saveProperties(null);
return "index.do";
}
......
......@@ -576,14 +576,14 @@ public class WebServer implements Service {
*
* @param prop null or the properties webPort, webAllowOthers, and webSSL
*/
synchronized void saveSettings(Properties prop) {
synchronized void saveProperties(Properties prop) {
try {
if (prop == null) {
Properties old = loadProperties();
prop = new SortedProperties();
prop.setProperty("webPort", "" + SortedProperties.getIntProperty(old, "webPort", port));
prop.setProperty("webAllowOthers", "" + SortedProperties.getBooleanProperty(old, "webAllowOthers", ssl));
prop.setProperty("webSSL", "" + SortedProperties.getBooleanProperty(old, "webSSL", allowOthers));
prop.setProperty("webAllowOthers", "" + SortedProperties.getBooleanProperty(old, "webAllowOthers", allowOthers));
prop.setProperty("webSSL", "" + SortedProperties.getBooleanProperty(old, "webSSL", ssl));
}
ArrayList<ConnectionInfo> settings = getSettings();
int len = settings.size();
......@@ -593,7 +593,8 @@ public class WebServer implements Service {
prop.setProperty(String.valueOf(len - i - 1), info.getString());
}
}
OutputStream out = IOUtils.openFileOutputStream(getPropertiesFileName(), false);
String fileName = getPropertiesFileName();
OutputStream out = IOUtils.openFileOutputStream(fileName, false);
prop.store(out, "H2 Server Properties");
out.close();
} catch (Exception e) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论