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

This commit is contained in:
r-ca 2024-01-09 12:24:56 +09:00
parent 5c931ece3f
commit 9e5b2dad46
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9

View File

@ -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