Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
18655e85
提交
18655e85
authored
5月 10, 2009
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
H2 Console: command line settings are now longer stored.
上级
8ea55147
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
23 行增加
和
15 行删除
+23
-15
WebServer.java
h2/src/main/org/h2/server/web/WebServer.java
+9
-9
WebThread.java
h2/src/main/org/h2/server/web/WebThread.java
+14
-6
没有找到文件。
h2/src/main/org/h2/server/web/WebServer.java
浏览文件 @
18655e85
...
@@ -113,7 +113,6 @@ public class WebServer implements Service {
...
@@ -113,7 +113,6 @@ public class WebServer implements Service {
// }
// }
// private URLClassLoader urlClassLoader;
// private URLClassLoader urlClassLoader;
private
String
driverList
;
private
int
port
;
private
int
port
;
private
boolean
allowOthers
;
private
boolean
allowOthers
;
private
Set
running
=
Collections
.
synchronizedSet
(
new
HashSet
());
private
Set
running
=
Collections
.
synchronizedSet
(
new
HashSet
());
...
@@ -221,7 +220,6 @@ public class WebServer implements Service {
...
@@ -221,7 +220,6 @@ public class WebServer implements Service {
public
void
init
(
String
[]
args
)
{
public
void
init
(
String
[]
args
)
{
// TODO web: support using a different properties file
// TODO web: support using a different properties file
Properties
prop
=
loadProperties
();
Properties
prop
=
loadProperties
();
driverList
=
prop
.
getProperty
(
"drivers"
);
port
=
SortedProperties
.
getIntProperty
(
prop
,
"webPort"
,
Constants
.
DEFAULT_HTTP_PORT
);
port
=
SortedProperties
.
getIntProperty
(
prop
,
"webPort"
,
Constants
.
DEFAULT_HTTP_PORT
);
ssl
=
SortedProperties
.
getBooleanProperty
(
prop
,
"webSSL"
,
Constants
.
DEFAULT_HTTP_SSL
);
ssl
=
SortedProperties
.
getBooleanProperty
(
prop
,
"webSSL"
,
Constants
.
DEFAULT_HTTP_SSL
);
allowOthers
=
SortedProperties
.
getBooleanProperty
(
prop
,
"webAllowOthers"
,
Constants
.
DEFAULT_HTTP_ALLOW_OTHERS
);
allowOthers
=
SortedProperties
.
getBooleanProperty
(
prop
,
"webAllowOthers"
,
Constants
.
DEFAULT_HTTP_ALLOW_OTHERS
);
...
@@ -573,16 +571,18 @@ public class WebServer implements Service {
...
@@ -573,16 +571,18 @@ public class WebServer implements Service {
/**
/**
* Save the settings to the properties file.
* Save the settings to the properties file.
*
* @param prop null or the properties webPort, webAllowOthers, and webSSL
*/
*/
synchronized
void
saveSettings
()
{
synchronized
void
saveSettings
(
Properties
prop
)
{
try
{
try
{
Properties
prop
=
new
SortedProperties
();
if
(
prop
==
null
)
{
if
(
driverList
!=
null
)
{
Properties
old
=
loadProperties
();
prop
.
setProperty
(
"drivers"
,
driverList
);
prop
=
new
SortedProperties
();
prop
.
setProperty
(
"webPort"
,
old
.
getProperty
(
"webPort"
));
prop
.
setProperty
(
"webAllowOthers"
,
old
.
getProperty
(
"webAllowOthers"
));
prop
.
setProperty
(
"webSSL"
,
old
.
getProperty
(
"webSSL"
));
}
}
prop
.
setProperty
(
"webPort"
,
String
.
valueOf
(
port
));
prop
.
setProperty
(
"webAllowOthers"
,
String
.
valueOf
(
allowOthers
));
prop
.
setProperty
(
"webSSL"
,
String
.
valueOf
(
ssl
));
ArrayList
settings
=
getSettings
();
ArrayList
settings
=
getSettings
();
int
len
=
settings
.
size
();
int
len
=
settings
.
size
();
for
(
int
i
=
0
;
i
<
len
;
i
++)
{
for
(
int
i
=
0
;
i
<
len
;
i
++)
{
...
...
h2/src/main/org/h2/server/web/WebThread.java
浏览文件 @
18655e85
...
@@ -73,6 +73,7 @@ import org.h2.util.NetUtils;
...
@@ -73,6 +73,7 @@ import org.h2.util.NetUtils;
import
org.h2.util.ObjectArray
;
import
org.h2.util.ObjectArray
;
import
org.h2.util.ObjectUtils
;
import
org.h2.util.ObjectUtils
;
import
org.h2.util.ScriptReader
;
import
org.h2.util.ScriptReader
;
import
org.h2.util.SortedProperties
;
import
org.h2.util.StringUtils
;
import
org.h2.util.StringUtils
;
import
org.h2.util.Tool
;
import
org.h2.util.Tool
;
...
@@ -567,10 +568,17 @@ class WebThread extends Thread implements DatabaseEventListener {
...
@@ -567,10 +568,17 @@ class WebThread extends Thread implements DatabaseEventListener {
private
String
adminSave
()
{
private
String
adminSave
()
{
try
{
try
{
server
.
setPort
(
MathUtils
.
decodeInt
((
String
)
attributes
.
get
(
"port"
)));
Properties
prop
=
new
SortedProperties
();
server
.
setAllowOthers
(
Boolean
.
valueOf
((
String
)
attributes
.
get
(
"allowOthers"
)).
booleanValue
());
int
port
=
MathUtils
.
decodeInt
((
String
)
attributes
.
get
(
"port"
));
server
.
setSSL
(
Boolean
.
valueOf
((
String
)
attributes
.
get
(
"ssl"
)).
booleanValue
());
prop
.
setProperty
(
"webPort"
,
String
.
valueOf
(
port
));
server
.
saveSettings
();
server
.
setPort
(
port
);
boolean
allowOthers
=
Boolean
.
valueOf
((
String
)
attributes
.
get
(
"allowOthers"
)).
booleanValue
();
prop
.
setProperty
(
"webAllowOthers"
,
String
.
valueOf
(
allowOthers
));
server
.
setAllowOthers
(
allowOthers
);
boolean
ssl
=
Boolean
.
valueOf
((
String
)
attributes
.
get
(
"ssl"
)).
booleanValue
();
prop
.
setProperty
(
"webSSL"
,
String
.
valueOf
(
ssl
));
server
.
setSSL
(
ssl
);
server
.
saveSettings
(
prop
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
trace
(
e
.
toString
());
trace
(
e
.
toString
());
}
}
...
@@ -2065,7 +2073,7 @@ class WebThread extends Thread implements DatabaseEventListener {
...
@@ -2065,7 +2073,7 @@ class WebThread extends Thread implements DatabaseEventListener {
info
.
user
=
attributes
.
getProperty
(
"user"
,
""
);
info
.
user
=
attributes
.
getProperty
(
"user"
,
""
);
server
.
updateSetting
(
info
);
server
.
updateSetting
(
info
);
attributes
.
put
(
"setting"
,
info
.
name
);
attributes
.
put
(
"setting"
,
info
.
name
);
server
.
saveSettings
();
server
.
saveSettings
(
null
);
return
"index.do"
;
return
"index.do"
;
}
}
...
@@ -2102,7 +2110,7 @@ class WebThread extends Thread implements DatabaseEventListener {
...
@@ -2102,7 +2110,7 @@ class WebThread extends Thread implements DatabaseEventListener {
if
(
settings
.
size
()
>
0
)
{
if
(
settings
.
size
()
>
0
)
{
attributes
.
put
(
"setting"
,
settings
.
get
(
0
));
attributes
.
put
(
"setting"
,
settings
.
get
(
0
));
}
}
server
.
saveSettings
();
server
.
saveSettings
(
null
);
return
"index.do"
;
return
"index.do"
;
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论