ファイルを取得するメソッド作成

This commit is contained in:
r-ca 2024-01-08 11:42:58 +09:00
parent 88cd58f920
commit 52657fdbbd
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9
2 changed files with 15 additions and 0 deletions

View File

@ -23,6 +23,9 @@ public interface FileManager {
File createFile(String fileName);
void removeFile(String fileName);
File getFile(String fileName);
File getFile(Path path);
boolean isExist(Path path);
boolean isExist(String fileName);

View File

@ -137,6 +137,18 @@ public class FileManagerImpl implements FileManager {
currentDir.resolve(fileName).toFile().delete(); // TODO-rca: エラーハンドリング
}
@Override
public File getFile(String fileName) {
logger.debug("getFile", "called");
return currentDir.resolve(fileName).toFile();
}
@Override
public File getFile(Path path) {
logger.debug("getFile", "called");
return path.toFile();
}
@Override
public boolean isExist(Path path) {
logger.debug("isExist", "called");