Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
9441d4c6
提交
9441d4c6
authored
8月 09, 2016
作者:
Stefan Bodewig
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
honor quiet in ChangeFileEncryption progress logging
上级
979ad281
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
8 行增加
和
8 行删除
+8
-8
ChangeFileEncryption.java
h2/src/main/org/h2/tools/ChangeFileEncryption.java
+8
-8
没有找到文件。
h2/src/main/org/h2/tools/ChangeFileEncryption.java
浏览文件 @
9441d4c6
...
@@ -186,15 +186,15 @@ public class ChangeFileEncryption extends Tool {
...
@@ -186,15 +186,15 @@ public class ChangeFileEncryption extends Tool {
for
(
String
fileName
:
files
)
{
for
(
String
fileName
:
files
)
{
// don't process a lob directory, just the files in the directory.
// don't process a lob directory, just the files in the directory.
if
(!
FileUtils
.
isDirectory
(
fileName
))
{
if
(!
FileUtils
.
isDirectory
(
fileName
))
{
change
.
process
(
fileName
);
change
.
process
(
fileName
,
quiet
);
}
}
}
}
}
}
private
void
process
(
String
fileName
)
{
private
void
process
(
String
fileName
,
boolean
quiet
)
{
if
(
fileName
.
endsWith
(
Constants
.
SUFFIX_MV_FILE
))
{
if
(
fileName
.
endsWith
(
Constants
.
SUFFIX_MV_FILE
))
{
try
{
try
{
copy
(
fileName
);
copy
(
fileName
,
quiet
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
throw
DbException
.
convertIOException
(
e
,
throw
DbException
.
convertIOException
(
e
,
"Error encrypting / decrypting file "
+
fileName
);
"Error encrypting / decrypting file "
+
fileName
);
...
@@ -209,13 +209,13 @@ public class ChangeFileEncryption extends Tool {
...
@@ -209,13 +209,13 @@ public class ChangeFileEncryption extends Tool {
}
}
try
{
try
{
in
.
init
();
in
.
init
();
copy
(
fileName
,
in
,
encrypt
);
copy
(
fileName
,
in
,
encrypt
,
quiet
);
}
finally
{
}
finally
{
in
.
closeSilently
();
in
.
closeSilently
();
}
}
}
}
private
void
copy
(
String
fileName
)
throws
IOException
{
private
void
copy
(
String
fileName
,
boolean
quiet
)
throws
IOException
{
if
(
FileUtils
.
isDirectory
(
fileName
))
{
if
(
FileUtils
.
isDirectory
(
fileName
))
{
return
;
return
;
}
}
...
@@ -238,7 +238,7 @@ public class ChangeFileEncryption extends Tool {
...
@@ -238,7 +238,7 @@ public class ChangeFileEncryption extends Tool {
long
total
=
remaining
;
long
total
=
remaining
;
long
time
=
System
.
currentTimeMillis
();
long
time
=
System
.
currentTimeMillis
();
while
(
remaining
>
0
)
{
while
(
remaining
>
0
)
{
if
(
System
.
currentTimeMillis
()
-
time
>
1000
)
{
if
(
!
quiet
&&
System
.
currentTimeMillis
()
-
time
>
1000
)
{
out
.
println
(
fileName
+
": "
+
(
100
-
100
*
remaining
/
total
)
+
"%"
);
out
.
println
(
fileName
+
": "
+
(
100
-
100
*
remaining
/
total
)
+
"%"
);
time
=
System
.
currentTimeMillis
();
time
=
System
.
currentTimeMillis
();
}
}
...
@@ -259,7 +259,7 @@ public class ChangeFileEncryption extends Tool {
...
@@ -259,7 +259,7 @@ public class ChangeFileEncryption extends Tool {
FileUtils
.
move
(
temp
,
fileName
);
FileUtils
.
move
(
temp
,
fileName
);
}
}
private
void
copy
(
String
fileName
,
FileStore
in
,
byte
[]
key
)
{
private
void
copy
(
String
fileName
,
FileStore
in
,
byte
[]
key
,
boolean
quiet
)
{
if
(
FileUtils
.
isDirectory
(
fileName
))
{
if
(
FileUtils
.
isDirectory
(
fileName
))
{
return
;
return
;
}
}
...
@@ -279,7 +279,7 @@ public class ChangeFileEncryption extends Tool {
...
@@ -279,7 +279,7 @@ public class ChangeFileEncryption extends Tool {
fileOut
.
seek
(
FileStore
.
HEADER_LENGTH
);
fileOut
.
seek
(
FileStore
.
HEADER_LENGTH
);
long
time
=
System
.
currentTimeMillis
();
long
time
=
System
.
currentTimeMillis
();
while
(
remaining
>
0
)
{
while
(
remaining
>
0
)
{
if
(
System
.
currentTimeMillis
()
-
time
>
1000
)
{
if
(
!
quiet
&&
System
.
currentTimeMillis
()
-
time
>
1000
)
{
out
.
println
(
fileName
+
": "
+
(
100
-
100
*
remaining
/
total
)
+
"%"
);
out
.
println
(
fileName
+
": "
+
(
100
-
100
*
remaining
/
total
)
+
"%"
);
time
=
System
.
currentTimeMillis
();
time
=
System
.
currentTimeMillis
();
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论