Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
7936f195
提交
7936f195
authored
11月 16, 2011
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Server.createTcpServer, createPgServer, createWebServer: invalid arguments are now detected.
上级
ad43aaf7
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
26 行增加
和
3 行删除
+26
-3
Console.java
h2/src/main/org/h2/tools/Console.java
+1
-1
Server.java
h2/src/main/org/h2/tools/Server.java
+22
-0
Tool.java
h2/src/main/org/h2/util/Tool.java
+2
-1
TestTools.java
h2/src/test/org/h2/test/unit/TestTools.java
+1
-1
没有找到文件。
h2/src/main/org/h2/tools/Console.java
浏览文件 @
7936f195
...
@@ -254,7 +254,7 @@ ShutdownHandler {
...
@@ -254,7 +254,7 @@ ShutdownHandler {
// start browser in any case (even if the server is already running)
// start browser in any case (even if the server is already running)
// because some people don't look at the output,
// because some people don't look at the output,
// but are wondering why nothing happens
// but are wondering why nothing happens
if
(
browserStart
)
{
if
(
browserStart
&&
web
!=
null
)
{
openBrowser
(
web
.
getURL
());
openBrowser
(
web
.
getURL
());
}
}
...
...
h2/src/main/org/h2/tools/Server.java
浏览文件 @
7936f195
...
@@ -171,6 +171,22 @@ public class Server extends Tool implements Runnable, ShutdownHandler {
...
@@ -171,6 +171,22 @@ public class Server extends Tool implements Runnable, ShutdownHandler {
}
else
{
}
else
{
throwUnsupportedOption
(
arg
);
throwUnsupportedOption
(
arg
);
}
}
}
else
if
(
arg
.
startsWith
(
"-ftp"
))
{
if
(
"-ftpPort"
.
equals
(
arg
))
{
i
++;
}
else
if
(
"-ftpDir"
.
equals
(
arg
))
{
i
++;
}
else
if
(
"-ftpRead"
.
equals
(
arg
))
{
i
++;
}
else
if
(
"-ftpWrite"
.
equals
(
arg
))
{
i
++;
}
else
if
(
"-ftpWritePassword"
.
equals
(
arg
))
{
i
++;
}
else
if
(
"-ftpTask"
.
equals
(
arg
))
{
// no parameters
}
else
{
throwUnsupportedOption
(
arg
);
}
}
else
if
(
"-properties"
.
equals
(
arg
))
{
}
else
if
(
"-properties"
.
equals
(
arg
))
{
i
++;
i
++;
}
else
if
(
"-trace"
.
equals
(
arg
))
{
}
else
if
(
"-trace"
.
equals
(
arg
))
{
...
@@ -179,6 +195,10 @@ public class Server extends Tool implements Runnable, ShutdownHandler {
...
@@ -179,6 +195,10 @@ public class Server extends Tool implements Runnable, ShutdownHandler {
// no parameters
// no parameters
}
else
if
(
"-baseDir"
.
equals
(
arg
))
{
}
else
if
(
"-baseDir"
.
equals
(
arg
))
{
i
++;
i
++;
}
else
if
(
"-key"
.
equals
(
arg
))
{
i
+=
2
;
}
else
if
(
"-tool"
.
equals
(
arg
))
{
// no parameters
}
else
{
}
else
{
throwUnsupportedOption
(
arg
);
throwUnsupportedOption
(
arg
);
}
}
...
@@ -261,6 +281,8 @@ public class Server extends Tool implements Runnable, ShutdownHandler {
...
@@ -261,6 +281,8 @@ public class Server extends Tool implements Runnable, ShutdownHandler {
// no parameters
// no parameters
}
else
if
(
"-baseDir"
.
equals
(
arg
))
{
}
else
if
(
"-baseDir"
.
equals
(
arg
))
{
i
++;
i
++;
}
else
if
(
"-key"
.
equals
(
arg
))
{
i
+=
2
;
}
else
{
}
else
{
showUsageAndThrowUnsupportedOption
(
arg
);
showUsageAndThrowUnsupportedOption
(
arg
);
}
}
...
...
h2/src/main/org/h2/util/Tool.java
浏览文件 @
7936f195
...
@@ -11,6 +11,7 @@ import java.io.IOException;
...
@@ -11,6 +11,7 @@ import java.io.IOException;
import
java.io.PrintStream
;
import
java.io.PrintStream
;
import
java.sql.SQLException
;
import
java.sql.SQLException
;
import
java.util.Properties
;
import
java.util.Properties
;
import
org.h2.constant.ErrorCode
;
import
org.h2.message.DbException
;
import
org.h2.message.DbException
;
import
org.h2.store.FileLister
;
import
org.h2.store.FileLister
;
import
org.h2.store.fs.FileUtils
;
import
org.h2.store.fs.FileUtils
;
...
@@ -62,7 +63,7 @@ public abstract class Tool {
...
@@ -62,7 +63,7 @@ public abstract class Tool {
* @return this method never returns normally
* @return this method never returns normally
*/
*/
protected
SQLException
throwUnsupportedOption
(
String
option
)
throws
SQLException
{
protected
SQLException
throwUnsupportedOption
(
String
option
)
throws
SQLException
{
throw
new
SQLException
(
"Unsupported option: "
+
option
);
throw
DbException
.
get
(
ErrorCode
.
FEATURE_NOT_SUPPORTED_1
,
option
).
getSQLException
(
);
}
}
/**
/**
...
...
h2/src/test/org/h2/test/unit/TestTools.java
浏览文件 @
7936f195
...
@@ -448,7 +448,7 @@ public class TestTools extends TestBase {
...
@@ -448,7 +448,7 @@ public class TestTools extends TestBase {
result
=
runServer
(
1
,
new
String
[]{
"-xy"
});
result
=
runServer
(
1
,
new
String
[]{
"-xy"
});
assertTrue
(
result
.
indexOf
(
"Starts the H2 Console"
)
>=
0
);
assertTrue
(
result
.
indexOf
(
"Starts the H2 Console"
)
>=
0
);
assertTrue
(
result
.
indexOf
(
"
Unsupported option
"
)
>=
0
);
assertTrue
(
result
.
indexOf
(
"
Feature not supported
"
)
>=
0
);
result
=
runServer
(
0
,
new
String
[]{
"-tcp"
,
"-tcpPort"
,
"9001"
,
"-tcpPassword"
,
"abc"
});
result
=
runServer
(
0
,
new
String
[]{
"-tcp"
,
"-tcpPort"
,
"9001"
,
"-tcpPassword"
,
"abc"
});
assertTrue
(
result
.
indexOf
(
"tcp://"
)
>=
0
);
assertTrue
(
result
.
indexOf
(
"tcp://"
)
>=
0
);
assertTrue
(
result
.
indexOf
(
":9001"
)
>=
0
);
assertTrue
(
result
.
indexOf
(
":9001"
)
>=
0
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论