-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFileCommand.java
More file actions
37 lines (31 loc) · 999 Bytes
/
FileCommand.java
File metadata and controls
37 lines (31 loc) · 999 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package java2;
import java.io.FileNotFoundException;
import java.io.IOException;
public class FileCommand extends FileHandler {
public FileCommand() throws FileNotFoundException {
super();
}
@Override
public void run() throws IOException {
while (true) {
System.out.println("추가: /write, 삭제: /delete, 검색: /search, 종료: /exit");
String cmd = scanner.nextLine();
switch (cmd){
case "/write":
new FileWrite().run();
break;
case "/delete":
new FileDelete().run();
break;
case "/search":
new FileSearch().run();
break;
case "/exit":
new FileExit().run();
break;
default:
System.out.println("잘못된 명령어 입니다");
}
}
}
}