読み書きの確認の前にファイルの存在を確認するように

This commit is contained in:
r-ca committed 2024-01-09 12:24:56 +09:00
1 parent 5c931ece3f
commit 9e5b2dad46
1 file changed
+12 -4
@@ -88,14 +88,22 @@ public class FileManagerImpl implements FileManager {
@Override
public boolean isReadable() {
File file = this.path.toFile();
return file.canRead();
if (this.isExist()) {
File file = this.path.toFile();
return file.canRead();
} else {
return false;
}
}
@Override
public boolean isWritable() {
File file = this.path.toFile();
return file.canWrite();
if (this.isExist()) {
File file = this.path.toFile();
return file.canWrite();
} else {
return false;
}
}
@Override