Minor improvements of coffee-manager.

This commit is contained in:
Niclas Finne 2012-11-19 14:47:35 +01:00 committed by Nicolas Tsiftes
parent c23bb4cc5c
commit 2f72cb043d
3 changed files with 32 additions and 35 deletions

View file

@ -40,20 +40,18 @@ import se.sics.coffee.CoffeeFS.CoffeeException;
import se.sics.coffee.CoffeeFS.CoffeeFileException;
public class CoffeeManager {
private static CoffeeFS coffeeFS;
public enum Command { INSERT, EXTRACT, REMOVE, LIST, STATS };
public static void main(String args[]) {
String platform = "sky";
String usage = "Usage: java -jar coffee.jar ";
Command command = Command.STATS;
String filename = "";
String fsImage = "";
usage += "[-p <hardware platform>] ";
usage += "[-i|e|r <file>] ";
usage += "[-l|s] ";
usage += "<file system image>";
String usage = "Usage: java -jar coffee.jar " +
"[-p <hardware platform>] " +
"[-i|e|r <file>] " +
"[-l|s] " +
"<file system image>";
if (args.length < 2) {
System.err.println(usage);
@ -98,7 +96,7 @@ public class CoffeeManager {
try {
CoffeeConfiguration conf = new CoffeeConfiguration(platform + ".properties");
coffeeFS = new CoffeeFS(new CoffeeImageFile(fsImage, conf));
CoffeeFS coffeeFS = new CoffeeFS(new CoffeeImageFile(fsImage, conf));
switch (command) {
case INSERT:
if (coffeeFS.getFiles().get(filename) != null) {