提交 0a8092b3 authored 作者: christian.peter.io's avatar christian.peter.io

FileLister with option "all" now also returns all ".part" files (from the split file system)

上级 1ff3256b
......@@ -353,6 +353,11 @@ public class Constants {
* The file name suffix of trace files.
*/
public static final String SUFFIX_TRACE_FILE = ".trace.db";
/**
* The file name suffix of split files.
*/
public static final String SUFFIX_SPLIT_FILE = ".part";
/**
* The delay that is to be used if throttle has been enabled.
......
......@@ -107,6 +107,8 @@ public class FileLister {
ok = true;
} else if (f.endsWith(Constants.SUFFIX_TRACE_FILE)) {
ok = true;
} else if (f.endsWith(Constants.SUFFIX_SPLIT_FILE)) {
ok = true;
}
}
if (ok) {
......
......@@ -13,6 +13,7 @@ import java.io.SequenceInputStream;
import java.util.ArrayList;
import org.h2.constant.SysProperties;
import org.h2.engine.Constants;
import org.h2.message.DbException;
import org.h2.util.New;
......@@ -24,7 +25,6 @@ public class FileSystemSplit extends FileSystem {
private static final String PREFIX = "split:";
private static final String PART_SUFFIX = ".part";
private long defaultMaxSize = 1L << SysProperties.SPLIT_FILE_SIZE_SHIFT;
static {
......@@ -174,7 +174,7 @@ public class FileSystemSplit extends FileSystem {
ArrayList<String> list = New.arrayList();
for (int i = 0; i < array.length; i++) {
String f = array[i];
if (f.endsWith(PART_SUFFIX)) {
if (f.endsWith(Constants.SUFFIX_SPLIT_FILE)) {
continue;
}
array[i] = f = PREFIX + f;
......@@ -312,7 +312,7 @@ public class FileSystemSplit extends FileSystem {
*/
static String getFileName(String fileName, int id) {
if (id > 0) {
fileName += "." + id + PART_SUFFIX;
fileName += "." + id + Constants.SUFFIX_SPLIT_FILE;
}
return fileName;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论