提交 5f0df88a authored 作者: noelgrandin's avatar noelgrandin

these methods are only called from Database, so pass it in directly

上级 f161e9f5
...@@ -16,6 +16,7 @@ import java.sql.PreparedStatement; ...@@ -16,6 +16,7 @@ import java.sql.PreparedStatement;
import java.sql.SQLException; import java.sql.SQLException;
import org.h2.constant.SysProperties; import org.h2.constant.SysProperties;
import org.h2.engine.Constants; import org.h2.engine.Constants;
import org.h2.engine.Database;
import org.h2.message.DbException; import org.h2.message.DbException;
import org.h2.mvstore.DataUtils; import org.h2.mvstore.DataUtils;
import org.h2.store.DataHandler; import org.h2.store.DataHandler;
...@@ -707,21 +708,21 @@ public class ValueLob extends Value { ...@@ -707,21 +708,21 @@ public class ValueLob extends Value {
/** /**
* Remove all lobs for a given table id. * Remove all lobs for a given table id.
* *
* @param handler the data handler * @param database the database
* @param tableId the table id * @param tableId the table id
*/ */
public static void removeAllForTable(DataHandler handler, int tableId) { public static void removeAllForTable(Database database, int tableId) {
String dir = getFileNamePrefix(handler.getDatabasePath(), 0); String dir = getFileNamePrefix(database.getDatabasePath(), 0);
removeAllForTable(handler, dir, tableId); removeAllForTable(database, dir, tableId);
} }
private static void removeAllForTable(DataHandler handler, String dir, int tableId) { private static void removeAllForTable(Database database, String dir, int tableId) {
for (String name : FileUtils.newDirectoryStream(dir)) { for (String name : FileUtils.newDirectoryStream(dir)) {
if (FileUtils.isDirectory(name)) { if (FileUtils.isDirectory(name)) {
removeAllForTable(handler, name, tableId); removeAllForTable(database, name, tableId);
} else { } else {
if (name.endsWith(".t" + tableId + Constants.SUFFIX_LOB_FILE)) { if (name.endsWith(".t" + tableId + Constants.SUFFIX_LOB_FILE)) {
deleteFile(handler, name); deleteFile(database, name);
} }
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论