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