-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit a43d966
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
out/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.colinchartier.mvcexample; | ||
|
||
import java.io.BufferedReader; | ||
import java.io.File; | ||
import java.io.IOException; | ||
import java.io.InputStreamReader; | ||
|
||
public class Main { | ||
public static void main(String[] args) throws IOException { | ||
String path = "/"; | ||
|
||
BufferedReader r = new BufferedReader(new InputStreamReader(System.in)); | ||
while(true) { | ||
System.out.print("> "); | ||
String line = r.readLine(); | ||
if("ls".equals(line)) { | ||
for(File f : new File(path).listFiles()) { | ||
System.out.println("File: " + f); | ||
} | ||
} else if(line.startsWith("cd")) { | ||
path = line.split(" ", 2)[1]; | ||
System.out.println("Path is now " + path); | ||
} else if("pwd".equals(line)) { | ||
System.out.println("Current path: " + path); | ||
} else if("exit".equals(line)) { | ||
System.exit(0); | ||
} | ||
} | ||
} | ||
} |