-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmkdirCommand.java
More file actions
30 lines (27 loc) · 810 Bytes
/
mkdirCommand.java
File metadata and controls
30 lines (27 loc) · 810 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
package com.company;
import java.io.File;
import java.nio.file.Path;
import java.nio.file.Paths;
public class mkdirCommand extends Command{
mkdirCommand(Path _terminal , String[]_args){
TerminalPath = _terminal;
args = _args;
}
protected boolean check(){
return args.length ==1 ; ///todo
}
protected void run(String _path){
// args[0] = toAbsolutePath(args[0]);
myPath = Paths.get(toAbsolutePath(args[0]));
TerminalPath = Paths.get(_path);
if(check()){
// new File(TerminalPath.toString() +"/" + args[0]).mkdir();
new File(myPath.toString()).mkdir();
}
else {
System.out.println("error too much arguments");
}
}
protected void ShowArguments(){ ///todo
}
}