public static Command createCommand(String line){
		try{
			ArrayList<String> fields = new ArrayList<String>(4);
			fields.add(Command.CREATE_COMMAND,"create");
			fields.add(Command.REMOVE_COMMAND,"remove");
			fields.add(Command.READ_COMMAND,"read");
			fields.add(Command.WRITE_COMMAND,"write");
			boolean nocommand = false;
			int first = line.indexOf('-');
			int second = line.indexOf(' ', first+1);
			if(second == -1){
				second = line.length();
				nocommand = true;
			}
			String command = line.substring(first+1, second);
			command = command.toLowerCase();
			
			if(fields.contains(command) && nocommand) return new NoCommand("No arguments");
			String argument = line.substring(second+1);
			switch(fields.indexOf(command)){
			case Command.CREATE_COMMAND:
				return new CreateCommand(argument);
			case Command.REMOVE_COMMAND:
				return new RemoveCommand(argument);
			case Command.READ_COMMAND:
				return new ReadCommand(argument);
			case Command.WRITE_COMMAND:
				return new WriteCommand(argument);
			}
		}catch(Exception e){}
			try {
				return new NoCommand("Invalid command");
			} catch (AccessException e) {
				return null;
			}
	}