Currentを確認するメソッド追加

This commit is contained in:
r-ca 2024-01-08 15:06:33 +09:00
parent f7b8006fa4
commit ce834a7cfd
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9
2 changed files with 7 additions and 0 deletions

View File

@ -13,6 +13,8 @@ import java.util.List;
public interface FileManager { public interface FileManager {
Path getRootDir(); Path getRootDir();
Path getCurrentDir();
void changeDir(String dirName); //cd void changeDir(String dirName); //cd
void changeDir(Path path); //cd void changeDir(Path path); //cd
void backDir(); //cd .. void backDir(); //cd ..

View File

@ -59,6 +59,11 @@ public class FileManagerImpl implements FileManager {
return rootDir; return rootDir;
} }
@Override
public Path getCurrentDir() {
return currentDir;
}
@Override @Override
public void changeDir(String dirName) { public void changeDir(String dirName) {
this.currentDir = rootDir.resolve(dirName); this.currentDir = rootDir.resolve(dirName);