提交 889c911b authored 作者: Thomas Mueller's avatar Thomas Mueller

Slightly simplified FileSystem copy

上级 4496b4cc
...@@ -21,7 +21,6 @@ import org.h2.store.DataHandler; ...@@ -21,7 +21,6 @@ import org.h2.store.DataHandler;
import org.h2.store.FileStore; import org.h2.store.FileStore;
import org.h2.store.FileStoreInputStream; import org.h2.store.FileStoreInputStream;
import org.h2.store.FileStoreOutputStream; import org.h2.store.FileStoreOutputStream;
import org.h2.store.fs.FileSystem;
import org.h2.util.IOUtils; import org.h2.util.IOUtils;
import org.h2.util.MathUtils; import org.h2.util.MathUtils;
import org.h2.util.SmallLRUCache; import org.h2.util.SmallLRUCache;
...@@ -758,7 +757,11 @@ public class ValueLob extends Value { ...@@ -758,7 +757,11 @@ public class ValueLob extends Value {
private static void copyFileTo(DataHandler h, String sourceFileName, String targetFileName) { private static void copyFileTo(DataHandler h, String sourceFileName, String targetFileName) {
synchronized (h.getLobSyncObject()) { synchronized (h.getLobSyncObject()) {
FileSystem.getInstance(sourceFileName).copy(sourceFileName, targetFileName); try {
IOUtils.copy(sourceFileName, targetFileName);
} catch (IOException e) {
throw DbException.convertIOException(e, null);
}
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论