提交 b99aea62 authored 作者: Thomas Mueller's avatar Thomas Mueller

Slightly simplified code, link to root cause

上级 46538a69
......@@ -272,29 +272,27 @@ public class FileSystemDisk extends FileSystem {
}
private boolean canWriteInternal(File file) {
if (file.canWrite()) {
// Does not respect windows user permissions,
// so we must try to open it mode "rw".
if (!file.canWrite()) {
return false;
}
// File.canWrite() does not respect windows user permissions,
// so we must try to open it using the mode "rw".
// See also http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4420020
RandomAccessFile randomAccessFile = null;
RandomAccessFile r = null;
try {
randomAccessFile = new RandomAccessFile(file, "rw");
r = new RandomAccessFile(file, "rw");
return true;
} catch (FileNotFoundException e) {
return false;
} finally {
if (randomAccessFile != null) {
if (r != null) {
try {
randomAccessFile.close();
} catch (Exception e) {
r.close();
} catch (IOException e) {
// ignore
}
}
}
return true;
} else {
return false;
}
}
public void copy(String original, String copy) throws SQLException {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论