diff --git a/source/src/main/java/one/nem/lacerta/source/file/impl/FileManagerImpl.java b/source/src/main/java/one/nem/lacerta/source/file/impl/FileManagerImpl.java index 7912db6e..16e32ee1 100644 --- a/source/src/main/java/one/nem/lacerta/source/file/impl/FileManagerImpl.java +++ b/source/src/main/java/one/nem/lacerta/source/file/impl/FileManagerImpl.java @@ -82,13 +82,12 @@ public class FileManagerImpl implements FileManager { //ディレクトリ作成 logger.debug("createDir", "called"); - Path dir = currentDir.resolve(dirName); - if (!Files.exists(dir)) { - try { - Files.createDirectories(dir); - } catch (IOException e) { - e.printStackTrace(); - } + Path path = currentDir.resolve(dirName); + logger.debug("createDir", "path: " + path); + try { + Files.createDirectory(path); + } catch (IOException e) { + e.printStackTrace(); } } @@ -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: ファイル形式を変更できるようにする?