Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
31cf6d3f
提交
31cf6d3f
authored
11月 03, 2012
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Rename constants.
上级
53549619
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
29 行增加
和
29 行删除
+29
-29
CheckTextFiles.java
h2/src/tools/org/h2/build/code/CheckTextFiles.java
+13
-10
GenerateDoc.java
h2/src/tools/org/h2/build/doc/GenerateDoc.java
+2
-2
MergeDocs.java
h2/src/tools/org/h2/build/doc/MergeDocs.java
+4
-8
WebSite.java
h2/src/tools/org/h2/build/doc/WebSite.java
+7
-7
FtpServer.java
h2/src/tools/org/h2/dev/ftp/server/FtpServer.java
+3
-2
没有找到文件。
h2/src/tools/org/h2/build/code/CheckTextFiles.java
浏览文件 @
31cf6d3f
...
@@ -29,10 +29,13 @@ public class CheckTextFiles {
...
@@ -29,10 +29,13 @@ public class CheckTextFiles {
"layout"
,
"res"
,
"win"
,
"jar"
,
"task"
,
"svg"
,
"MF"
,
"mf"
,
"sh"
,
"DS_Store"
,
"prop"
};
"layout"
,
"res"
,
"win"
,
"jar"
,
"task"
,
"svg"
,
"MF"
,
"mf"
,
"sh"
,
"DS_Store"
,
"prop"
};
private
static
final
String
[]
SUFFIX_CRLF
=
{
"bat"
};
private
static
final
String
[]
SUFFIX_CRLF
=
{
"bat"
};
private
static
final
boolean
ALLOW_TAB
=
false
;
private
static
final
boolean
ALLOW_CR
=
true
;
private
static
final
boolean
ALLOW_TRAILING_SPACES
=
false
;
private
static
final
int
SPACES_PER_TAB
=
4
;
private
static
final
boolean
AUTO_FIX
=
true
;
private
boolean
failOnError
;
private
boolean
failOnError
;
private
static
final
boolean
allowTab
=
false
,
allowCR
=
true
,
allowTrailingSpaces
=
false
;
private
static
final
int
spacesPerTab
=
4
;
private
static
final
boolean
autoFix
=
true
;
private
boolean
useCRLF
;
private
boolean
useCRLF
;
private
final
String
[]
suffixIgnoreLicense
=
{
private
final
String
[]
suffixIgnoreLicense
=
{
"bat"
,
"nsi"
,
"txt"
,
"properties"
,
"xml"
,
"bat"
,
"nsi"
,
"txt"
,
"properties"
,
"xml"
,
...
@@ -111,7 +114,7 @@ public class CheckTextFiles {
...
@@ -111,7 +114,7 @@ public class CheckTextFiles {
}
}
}
}
if
(
check
)
{
if
(
check
)
{
checkOrFixFile
(
file
,
autoFix
,
checkLicense
);
checkOrFixFile
(
file
,
AUTO_FIX
,
checkLicense
);
}
}
}
}
}
}
...
@@ -163,7 +166,7 @@ public class CheckTextFiles {
...
@@ -163,7 +166,7 @@ public class CheckTextFiles {
return
;
return
;
}
else
if
(
ch
<
32
)
{
}
else
if
(
ch
<
32
)
{
if
(
ch
==
'\n'
)
{
if
(
ch
==
'\n'
)
{
if
(
lastWasWhitespace
&&
!
allowTrailingSpaces
)
{
if
(
lastWasWhitespace
&&
!
ALLOW_TRAILING_SPACES
)
{
fail
(
file
,
"contains trailing white space"
,
line
);
fail
(
file
,
"contains trailing white space"
,
line
);
return
;
return
;
}
}
...
@@ -176,11 +179,11 @@ public class CheckTextFiles {
...
@@ -176,11 +179,11 @@ public class CheckTextFiles {
lastWasWhitespace
=
false
;
lastWasWhitespace
=
false
;
line
++;
line
++;
}
else
if
(
ch
==
'\r'
)
{
}
else
if
(
ch
==
'\r'
)
{
if
(!
allow
CR
)
{
if
(!
ALLOW_
CR
)
{
fail
(
file
,
"contains CR"
,
line
);
fail
(
file
,
"contains CR"
,
line
);
return
;
return
;
}
}
if
(
lastWasWhitespace
&&
!
allowTrailingSpaces
)
{
if
(
lastWasWhitespace
&&
!
ALLOW_TRAILING_SPACES
)
{
fail
(
file
,
"contains trailing white space"
,
line
);
fail
(
file
,
"contains trailing white space"
,
line
);
return
;
return
;
}
}
...
@@ -188,11 +191,11 @@ public class CheckTextFiles {
...
@@ -188,11 +191,11 @@ public class CheckTextFiles {
// ok
// ok
}
else
if
(
ch
==
'\t'
)
{
}
else
if
(
ch
==
'\t'
)
{
if
(
fix
)
{
if
(
fix
)
{
for
(
int
j
=
0
;
j
<
spacesPerTab
;
j
++)
{
for
(
int
j
=
0
;
j
<
SPACES_PER_TAB
;
j
++)
{
out
.
write
(
' '
);
out
.
write
(
' '
);
}
}
}
else
{
}
else
{
if
(!
allowTab
)
{
if
(!
ALLOW_TAB
)
{
fail
(
file
,
"contains TAB"
,
line
);
fail
(
file
,
"contains TAB"
,
line
);
return
;
return
;
}
}
...
@@ -230,7 +233,7 @@ public class CheckTextFiles {
...
@@ -230,7 +233,7 @@ public class CheckTextFiles {
lastWasWhitespace
=
false
;
lastWasWhitespace
=
false
;
}
}
}
}
if
(
lastWasWhitespace
&&
!
allowTrailingSpaces
)
{
if
(
lastWasWhitespace
&&
!
ALLOW_TRAILING_SPACES
)
{
fail
(
file
,
"contains trailing white space at the very end"
,
line
);
fail
(
file
,
"contains trailing white space at the very end"
,
line
);
return
;
return
;
}
}
...
...
h2/src/tools/org/h2/build/doc/GenerateDoc.java
浏览文件 @
31cf6d3f
...
@@ -32,8 +32,8 @@ import org.h2.util.StringUtils;
...
@@ -32,8 +32,8 @@ import org.h2.util.StringUtils;
*/
*/
public
class
GenerateDoc
{
public
class
GenerateDoc
{
private
static
final
String
IN_HELP
=
"src/docsrc/help/help.csv"
;
private
String
inDir
=
"src/docsrc/html"
;
private
String
inDir
=
"src/docsrc/html"
;
private
static
final
String
inHelp
=
"src/docsrc/help/help.csv"
;
private
String
outDir
=
"docs/html"
;
private
String
outDir
=
"docs/html"
;
private
Connection
conn
;
private
Connection
conn
;
private
final
HashMap
<
String
,
Object
>
session
=
new
HashMap
<
String
,
Object
>();
private
final
HashMap
<
String
,
Object
>
session
=
new
HashMap
<
String
,
Object
>();
...
@@ -68,7 +68,7 @@ public class GenerateDoc {
...
@@ -68,7 +68,7 @@ public class GenerateDoc {
session
.
put
(
"stableVersion"
,
Constants
.
getVersionStable
());
session
.
put
(
"stableVersion"
,
Constants
.
getVersionStable
());
session
.
put
(
"stableVersionDate"
,
Constants
.
BUILD_DATE_STABLE
);
session
.
put
(
"stableVersionDate"
,
Constants
.
BUILD_DATE_STABLE
);
// String help = "SELECT * FROM INFORMATION_SCHEMA.HELP WHERE SECTION";
// String help = "SELECT * FROM INFORMATION_SCHEMA.HELP WHERE SECTION";
String
help
=
"SELECT ROWNUM ID, * FROM CSVREAD('"
+
inHelp
+
"', NULL, 'lineComment=#') WHERE SECTION "
;
String
help
=
"SELECT ROWNUM ID, * FROM CSVREAD('"
+
IN_HELP
+
"', NULL, 'lineComment=#') WHERE SECTION "
;
map
(
"commands"
,
help
+
"LIKE 'Commands%' ORDER BY ID"
,
true
);
map
(
"commands"
,
help
+
"LIKE 'Commands%' ORDER BY ID"
,
true
);
map
(
"commandsDML"
,
help
+
"= 'Commands (DML)' ORDER BY ID"
,
false
);
map
(
"commandsDML"
,
help
+
"= 'Commands (DML)' ORDER BY ID"
,
false
);
map
(
"commandsDDL"
,
help
+
"= 'Commands (DDL)' ORDER BY ID"
,
false
);
map
(
"commandsDDL"
,
help
+
"= 'Commands (DDL)' ORDER BY ID"
,
false
);
...
...
h2/src/tools/org/h2/build/doc/MergeDocs.java
浏览文件 @
31cf6d3f
...
@@ -20,7 +20,7 @@ import org.h2.util.StringUtils;
...
@@ -20,7 +20,7 @@ import org.h2.util.StringUtils;
*/
*/
public
class
MergeDocs
{
public
class
MergeDocs
{
private
static
final
String
baseDir
=
"docs/html"
;
private
static
final
String
BASE_DIR
=
"docs/html"
;
/**
/**
* This method is called when executing this application from the command
* This method is called when executing this application from the command
...
@@ -29,10 +29,6 @@ public class MergeDocs {
...
@@ -29,10 +29,6 @@ public class MergeDocs {
* @param args the command line parameters
* @param args the command line parameters
*/
*/
public
static
void
main
(
String
...
args
)
throws
Exception
{
public
static
void
main
(
String
...
args
)
throws
Exception
{
new
MergeDocs
().
run
();
}
private
void
run
()
throws
Exception
{
// the order of pages is important here
// the order of pages is important here
String
[]
pages
=
{
"quickstart.html"
,
"installation.html"
,
"tutorial.html"
,
"features.html"
,
String
[]
pages
=
{
"quickstart.html"
,
"installation.html"
,
"tutorial.html"
,
"features.html"
,
"performance.html"
,
"advanced.html"
,
"grammar.html"
,
"functions.html"
,
"datatypes.html"
,
"build.html"
,
"performance.html"
,
"advanced.html"
,
"grammar.html"
,
"functions.html"
,
"datatypes.html"
,
"build.html"
,
...
@@ -48,7 +44,7 @@ public class MergeDocs {
...
@@ -48,7 +44,7 @@ public class MergeDocs {
buff
.
append
(
text
);
buff
.
append
(
text
);
}
}
String
finalText
=
buff
.
toString
();
String
finalText
=
buff
.
toString
();
File
output
=
new
File
(
baseDir
,
"onePage.html"
);
File
output
=
new
File
(
BASE_DIR
,
"onePage.html"
);
PrintWriter
writer
=
new
PrintWriter
(
new
FileWriter
(
output
));
PrintWriter
writer
=
new
PrintWriter
(
new
FileWriter
(
output
));
writer
.
println
(
"<html><head><meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" /><title>"
);
writer
.
println
(
"<html><head><meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" /><title>"
);
writer
.
println
(
"H2 Documentation"
);
writer
.
println
(
"H2 Documentation"
);
...
@@ -85,8 +81,8 @@ public class MergeDocs {
...
@@ -85,8 +81,8 @@ public class MergeDocs {
return
text
;
return
text
;
}
}
private
String
getContent
(
String
fileName
)
throws
Exception
{
private
static
String
getContent
(
String
fileName
)
throws
Exception
{
File
file
=
new
File
(
baseDir
,
fileName
);
File
file
=
new
File
(
BASE_DIR
,
fileName
);
int
length
=
(
int
)
file
.
length
();
int
length
=
(
int
)
file
.
length
();
char
[]
data
=
new
char
[
length
];
char
[]
data
=
new
char
[
length
];
FileReader
reader
=
new
FileReader
(
file
);
FileReader
reader
=
new
FileReader
(
file
);
...
...
h2/src/tools/org/h2/build/doc/WebSite.java
浏览文件 @
31cf6d3f
...
@@ -34,8 +34,8 @@ public class WebSite {
...
@@ -34,8 +34,8 @@ public class WebSite {
private
static
final
String
TRANSLATE_START
=
"<!-- translate"
;
private
static
final
String
TRANSLATE_START
=
"<!-- translate"
;
private
static
final
String
TRANSLATE_END
=
"translate -->"
;
private
static
final
String
TRANSLATE_END
=
"translate -->"
;
private
static
final
String
sourceDir
=
"docs"
;
private
static
final
String
SOURCE_DIR
=
"docs"
;
private
static
final
String
webDir
=
"../h2web"
;
private
static
final
String
WEB_DIR
=
"../h2web"
;
private
final
HashMap
<
String
,
String
>
fragments
=
new
HashMap
<
String
,
String
>();
private
final
HashMap
<
String
,
String
>
fragments
=
new
HashMap
<
String
,
String
>();
/**
/**
...
@@ -50,17 +50,17 @@ public class WebSite {
...
@@ -50,17 +50,17 @@ public class WebSite {
private
void
run
()
throws
Exception
{
private
void
run
()
throws
Exception
{
// create the web site
// create the web site
deleteRecursive
(
new
File
(
webDir
));
deleteRecursive
(
new
File
(
WEB_DIR
));
loadFragments
();
loadFragments
();
copy
(
new
File
(
sourceDir
),
new
File
(
webDir
),
true
,
true
);
copy
(
new
File
(
SOURCE_DIR
),
new
File
(
WEB_DIR
),
true
,
true
);
Newsfeed
.
main
(
webDir
+
"/html"
);
Newsfeed
.
main
(
WEB_DIR
+
"/html"
);
// create the internal documentation
// create the internal documentation
copy
(
new
File
(
sourceDir
),
new
File
(
sourceDir
),
true
,
false
);
copy
(
new
File
(
SOURCE_DIR
),
new
File
(
SOURCE_DIR
),
true
,
false
);
}
}
private
void
loadFragments
()
throws
IOException
{
private
void
loadFragments
()
throws
IOException
{
File
dir
=
new
File
(
sourceDir
,
"html"
);
File
dir
=
new
File
(
SOURCE_DIR
,
"html"
);
for
(
File
f
:
dir
.
listFiles
())
{
for
(
File
f
:
dir
.
listFiles
())
{
if
(
f
.
getName
().
startsWith
(
"fragments"
))
{
if
(
f
.
getName
().
startsWith
(
"fragments"
))
{
FileInputStream
in
=
new
FileInputStream
(
f
);
FileInputStream
in
=
new
FileInputStream
(
f
);
...
...
h2/src/tools/org/h2/dev/ftp/server/FtpServer.java
浏览文件 @
31cf6d3f
...
@@ -65,10 +65,11 @@ public class FtpServer extends Tool implements Service {
...
@@ -65,10 +65,11 @@ public class FtpServer extends Tool implements Service {
static
final
String
TASK_SUFFIX
=
".task"
;
static
final
String
TASK_SUFFIX
=
".task"
;
private
static
final
int
MAX_CONNECTION_COUNT
=
100
;
private
ServerSocket
serverSocket
;
private
ServerSocket
serverSocket
;
private
int
port
=
DEFAULT_PORT
;
private
int
port
=
DEFAULT_PORT
;
private
int
openConnectionCount
;
private
int
openConnectionCount
;
private
static
final
int
maxConnectionCount
=
100
;
private
final
SimpleDateFormat
dateFormatNew
=
new
SimpleDateFormat
(
"MMM dd HH:mm"
,
Locale
.
ENGLISH
);
private
final
SimpleDateFormat
dateFormatNew
=
new
SimpleDateFormat
(
"MMM dd HH:mm"
,
Locale
.
ENGLISH
);
private
final
SimpleDateFormat
dateFormatOld
=
new
SimpleDateFormat
(
"MMM dd yyyy"
,
Locale
.
ENGLISH
);
private
final
SimpleDateFormat
dateFormatOld
=
new
SimpleDateFormat
(
"MMM dd yyyy"
,
Locale
.
ENGLISH
);
...
@@ -190,7 +191,7 @@ public class FtpServer extends Tool implements Service {
...
@@ -190,7 +191,7 @@ public class FtpServer extends Tool implements Service {
boolean
stop
;
boolean
stop
;
synchronized
(
this
)
{
synchronized
(
this
)
{
openConnectionCount
++;
openConnectionCount
++;
stop
=
openConnectionCount
>
maxConnectionCount
;
stop
=
openConnectionCount
>
MAX_CONNECTION_COUNT
;
}
}
FtpControl
c
=
new
FtpControl
(
s
,
this
,
stop
);
FtpControl
c
=
new
FtpControl
(
s
,
this
,
stop
);
c
.
start
();
c
.
start
();
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论