mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-30 03:23:16 +00:00
いくつかのメソッドで対応する引数を増やした
This commit is contained in:
parent
1ee0a1b8ea
commit
88cd58f920
|
@ -16,7 +16,9 @@ public interface FileManager {
|
||||||
void backRootDir(); //cd /
|
void backRootDir(); //cd /
|
||||||
List<Path> getList();
|
List<Path> getList();
|
||||||
void createDir(String dirName);
|
void createDir(String dirName);
|
||||||
|
void createDir(Path path);
|
||||||
void removeDir(String dirName);
|
void removeDir(String dirName);
|
||||||
|
void removeDir(Path path);
|
||||||
|
|
||||||
File createFile(String fileName);
|
File createFile(String fileName);
|
||||||
void removeFile(String fileName);
|
void removeFile(String fileName);
|
||||||
|
@ -25,6 +27,7 @@ public interface FileManager {
|
||||||
boolean isExist(String fileName);
|
boolean isExist(String fileName);
|
||||||
|
|
||||||
void autoCreateDir(Path path);
|
void autoCreateDir(Path path);
|
||||||
|
void autoCreateDir(String dirName);
|
||||||
|
|
||||||
void autoCreateToCurrentDir();
|
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
|
@Override
|
||||||
public void removeDir(String dirName) {
|
public void removeDir(String dirName) {
|
||||||
logger.debug("removeDir", "called");
|
logger.debug("removeDir", "called");
|
||||||
currentDir.resolve(dirName).toFile().delete(); // TODO-rca: エラーハンドリング
|
currentDir.resolve(dirName).toFile().delete(); // TODO-rca: エラーハンドリング
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void removeDir(Path path) {
|
||||||
|
logger.debug("removeDir", "called");
|
||||||
|
path.toFile().delete(); // TODO-rca: エラーハンドリング
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public File createFile(String fileName) {
|
public File createFile(String fileName) {
|
||||||
logger.debug("createFile", "called");
|
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
|
@Override
|
||||||
public void autoCreateToCurrentDir() {
|
public void autoCreateToCurrentDir() {
|
||||||
logger.debug("autoGenerateToCurrentDir", "called");
|
logger.debug("autoGenerateToCurrentDir", "called");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user