mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-26 17:53:14 +00:00
いくつかのメソッドで対応する引数を増やした
This commit is contained in:
parent
1ee0a1b8ea
commit
88cd58f920
|
@ -16,7 +16,9 @@ public interface FileManager {
|
|||
void backRootDir(); //cd /
|
||||
List<Path> getList();
|
||||
void createDir(String dirName);
|
||||
void createDir(Path path);
|
||||
void removeDir(String dirName);
|
||||
void removeDir(Path path);
|
||||
|
||||
File createFile(String fileName);
|
||||
void removeFile(String fileName);
|
||||
|
@ -25,6 +27,7 @@ public interface FileManager {
|
|||
boolean isExist(String fileName);
|
||||
|
||||
void autoCreateDir(Path path);
|
||||
void autoCreateDir(String dirName);
|
||||
|
||||
void autoCreateToCurrentDir();
|
||||
|
||||
|
|
|
@ -102,12 +102,29 @@ public class FileManagerImpl implements FileManager {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createDir(Path path) {
|
||||
logger.debug("createDir", "called");
|
||||
try {
|
||||
Files.createDirectory(path);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeDir(String dirName) {
|
||||
logger.debug("removeDir", "called");
|
||||
currentDir.resolve(dirName).toFile().delete(); // TODO-rca: エラーハンドリング
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeDir(Path path) {
|
||||
logger.debug("removeDir", "called");
|
||||
path.toFile().delete(); // TODO-rca: エラーハンドリング
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public File createFile(String fileName) {
|
||||
logger.debug("createFile", "called");
|
||||
|
@ -144,6 +161,18 @@ public class FileManagerImpl implements FileManager {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void autoCreateDir(String dirName) {
|
||||
logger.debug("autoCreateDir", "called");
|
||||
if (!Files.exists(currentDir.resolve(dirName))) {
|
||||
try {
|
||||
Files.createDirectories(currentDir.resolve(dirName));
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void autoCreateToCurrentDir() {
|
||||
logger.debug("autoGenerateToCurrentDir", "called");
|
||||
|
|
Loading…
Reference in New Issue
Block a user