diff --git a/source/src/main/java/one/nem/lacerta/source/file/FileManager.java b/source/src/main/java/one/nem/lacerta/source/file/FileManager.java index 24178915..9cc9e503 100644 --- a/source/src/main/java/one/nem/lacerta/source/file/FileManager.java +++ b/source/src/main/java/one/nem/lacerta/source/file/FileManager.java @@ -22,6 +22,7 @@ public interface FileManager { void removeFile(String fileName); boolean isExist(Path path); + boolean isExist(String fileName); void autoCreateDir(Path path); 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 63bfc3c1..4abdc172 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 @@ -54,6 +54,17 @@ public class FileManagerImpl implements FileManager { this.currentDir = rootDir.resolve(dirName); } + @Override + public void changeDir(Path path) { + if (path.startsWith(rootDir)) { + this.currentDir = path; + } + else { + logger.debug("changeDir", "invalid path: " + path); + // TODO-rca: 例外を投げる + } + } + @Override public void backDir() { this.currentDir = currentDir.getParent(); @@ -115,6 +126,12 @@ public class FileManagerImpl implements FileManager { return Files.exists(path); } + @Override + public boolean isExist(String fileName) { + logger.debug("isExist", "called"); + return Files.exists(currentDir.resolve(fileName)); + } + @Override public void autoCreateDir(Path path) { logger.debug("autoCreateDir", "called");