ファイルマネージャにメソッド追加, 微修正

This commit is contained in:
r-ca 2024-01-08 11:26:18 +09:00
parent 5a0b215626
commit 0fade2c41b
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9

View File

@ -82,15 +82,14 @@ public class FileManagerImpl implements FileManager {
//ディレクトリ作成
logger.debug("createDir", "called");
Path dir = currentDir.resolve(dirName);
if (!Files.exists(dir)) {
Path path = currentDir.resolve(dirName);
logger.debug("createDir", "path: " + path);
try {
Files.createDirectories(dir);
Files.createDirectory(path);
} catch (IOException e) {
e.printStackTrace();
}
}
}
@Override
public void removeDir(String dirName) {
@ -110,6 +109,24 @@ public class FileManagerImpl implements FileManager {
currentDir.resolve(fileName).toFile().delete(); // TODO-rca: エラーハンドリング
}
@Override
public boolean isExist(Path path) {
logger.debug("isExist", "called");
return Files.exists(path);
}
@Override
public void autoCreateDir(Path path) {
logger.debug("autoCreateDir", "called");
if (!Files.exists(path)) {
try {
Files.createDirectories(path);
} catch (IOException e) {
e.printStackTrace();
}
}
}
@Override
public void saveBitmapAtCurrent(Bitmap bitmap, String fileName) { // TODO-rca: ファイル形式を変更できるようにする