mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2026-11-02 11:37:37 +00:00
読み書きの確認の前にファイルの存在を確認するように
This commit is contained in:
1 file changed
+8
@@ -88,14 +88,22 @@ public class FileManagerImpl implements FileManager {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isReadable() {
|
public boolean isReadable() {
|
||||||
|
if (this.isExist()) {
|
||||||
File file = this.path.toFile();
|
File file = this.path.toFile();
|
||||||
return file.canRead();
|
return file.canRead();
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isWritable() {
|
public boolean isWritable() {
|
||||||
|
if (this.isExist()) {
|
||||||
File file = this.path.toFile();
|
File file = this.path.toFile();
|
||||||
return file.canWrite();
|
return file.canWrite();
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in new issue
Block a user