提交 9d4901f7 authored 作者: Thomas Mueller's avatar Thomas Mueller

Fix tests

上级 bec4a7d9
......@@ -212,13 +212,15 @@ public class ChangeFileEncryption extends Tool {
return;
}
FileChannel fileIn = FilePath.get(fileName).open("r");
FileChannel fileOut = null;
String temp = directory + "/temp.db";
try {
if (decryptKey != null) {
fileIn = new FilePathEncrypt.FileEncrypt(fileName, decryptKey, fileIn);
}
InputStream inStream = new FileChannelInputStream(fileIn, true);
String temp = directory + "/temp.db";
FileUtils.delete(temp);
FileChannel fileOut = FilePath.get(temp).open("rw");
fileOut = FilePath.get(temp).open("rw");
if (encryptKey != null) {
fileOut = new FilePathEncrypt.FileEncrypt(temp, encryptKey, fileOut);
}
......@@ -239,6 +241,12 @@ public class ChangeFileEncryption extends Tool {
}
inStream.close();
outStream.close();
} finally {
fileIn.close();
if (fileOut != null) {
fileOut.close();
}
}
FileUtils.delete(fileName);
FileUtils.moveTo(temp, fileName);
}
......
......@@ -502,16 +502,19 @@ public class Server extends Tool implements Runnable, ShutdownHandler {
}
private void stopAll() {
if (web != null && web.isRunning(false)) {
web.stop();
Server s = web;
if (s != null && s.isRunning(false)) {
s.stop();
web = null;
}
if (tcp != null && tcp.isRunning(false)) {
tcp.stop();
s = tcp;
if (s != null && s.isRunning(false)) {
s.stop();
tcp = null;
}
if (pg != null && pg.isRunning(false)) {
pg.stop();
s = pg;
if (s != null && s.isRunning(false)) {
s.stop();
pg = null;
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论