Index: /trunk/java-utils/.classpath
===================================================================
--- /trunk/java-utils/.classpath	(revision 477)
+++ /trunk/java-utils/.classpath	(revision 478)
@@ -1,7 +1,26 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
-	<classpathentry kind="output" path="bin"/>
+	<classpathentry kind="src" output="target/classes" path="src/main/java">
+		<attributes>
+			<attribute name="optional" value="true"/>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="src" output="target/test-classes" path="src/test/java">
+		<attributes>
+			<attribute name="optional" value="true"/>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
+		<attributes>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
+		<attributes>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="output" path="target/classes"/>
 </classpath>
Index: /trunk/java-utils/.project
===================================================================
--- /trunk/java-utils/.project	(revision 477)
+++ /trunk/java-utils/.project	(revision 478)
@@ -11,6 +11,12 @@
 			</arguments>
 		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.m2e.core.maven2Builder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
 	</buildSpec>
 	<natures>
+		<nature>org.eclipse.m2e.core.maven2Nature</nature>
 		<nature>org.eclipse.jdt.core.javanature</nature>
 	</natures>
Index: /trunk/java-utils/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- /trunk/java-utils/.settings/org.eclipse.jdt.core.prefs	(revision 477)
+++ /trunk/java-utils/.settings/org.eclipse.jdt.core.prefs	(revision 478)
@@ -1,3 +1,2 @@
-#Thu Jan 06 10:47:41 CET 2011
 eclipse.preferences.version=1
 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
@@ -10,3 +9,4 @@
 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
 org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
 org.eclipse.jdt.core.compiler.source=1.6
Index: /trunk/java-utils/.settings/org.eclipse.m2e.core.prefs
===================================================================
--- /trunk/java-utils/.settings/org.eclipse.m2e.core.prefs	(revision 478)
+++ /trunk/java-utils/.settings/org.eclipse.m2e.core.prefs	(revision 478)
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
Index: /trunk/java-utils/pom.xml
===================================================================
--- /trunk/java-utils/pom.xml	(revision 478)
+++ /trunk/java-utils/pom.xml	(revision 478)
@@ -0,0 +1,19 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>de.ugoe.cs</groupId>
+  <artifactId>java-utils</artifactId>
+  <version>0.0.1-SNAPSHOT</version>
+  <name>java-utils</name>
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>2.3.2</version>
+        <configuration>
+          <source>1.6</source>
+          <target>1.6</target>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
Index: /trunk/java-utils/src/main/java/de/ugoe/cs/util/ArrayTools.java
===================================================================
--- /trunk/java-utils/src/main/java/de/ugoe/cs/util/ArrayTools.java	(revision 478)
+++ /trunk/java-utils/src/main/java/de/ugoe/cs/util/ArrayTools.java	(revision 478)
@@ -0,0 +1,116 @@
+package de.ugoe.cs.util;
+
+/**
+ * <p>
+ * Helper class that provides methods to simplify working with arrays.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+final public class ArrayTools {
+
+	/**
+	 * <p>
+	 * Private constructor to prevent initializing of the class.
+	 * </p>
+	 */
+	private ArrayTools() {
+
+	}
+
+	/**
+	 * <p>
+	 * Finds the first occurrence of an object inside an array.
+	 * </p>
+	 * <p>
+	 * In case {@code other==null}, the first occurrence of a {@code null} value
+	 * in the array is returned.
+	 * </p>
+	 * 
+	 * @param array
+	 *            the array
+	 * @param other
+	 *            the object
+	 * @return index of the object if found, -1 otherwise
+	 */
+	public static int findIndex(Object[] array, Object other) {
+		int retVal = -1;
+		for (int i = 0; i < array.length && retVal == -1; i++) {
+			if (other != null) {
+				if (array[i] != null && array[i].equals(other)) {
+					retVal = i;
+				}
+			} else {
+				if (array[i] == null) {
+					retVal = i;
+				}
+			}
+		}
+		return retVal;
+	}
+
+	/**
+	 * <p>
+	 * Finds the highest element in an array. If multiple elements have the
+	 * maximum value, the index of the first one is returned; null-values are
+	 * ignored. In case the parameter array is null, has length 0 or contains
+	 * only null-values, -1 is returned.
+	 * </p>
+	 * 
+	 * @param <T>
+	 * @param array
+	 *            the array
+	 * @return index of the element with the highest value, -1 in case of an
+	 *         invalid parameter
+	 */
+	@SuppressWarnings("unchecked")
+	public static <T> int findMax(Comparable<T>[] array) {
+		int maxIndex = -1;
+		T maxElement = null;
+		if (array != null) {
+			for (int i = 0; i < array.length; i++) {
+				if (array[i] != null) {
+					if (maxElement == null
+							|| array[i].compareTo(maxElement) > 0) {
+						maxElement = (T) array[i];
+						maxIndex = i;
+					}
+				}
+			}
+		}
+		return maxIndex;
+	}
+
+	/**
+	 * <p>
+	 * Finds the lowest element in an array. If multiple elements have the
+	 * minimal value, the index of the first one is returned; null-values are
+	 * ignored. In case the parameter array is null, has length 0 or contains
+	 * only null-values, -1 is returned.
+	 * </p>
+	 * 
+	 * @param <T>
+	 * @param array
+	 *            the array
+	 * @return index of the element with the lowest value, -1 in case of an
+	 *         invalid parameter
+	 */
+	@SuppressWarnings("unchecked")
+	public static <T> int findMin(Comparable<T>[] array) {
+		int maxIndex = -1;
+		T maxElement = null;
+		if (array != null) {
+			for (int i = 0; i < array.length; i++) {
+				if (array[i] != null) {
+					if (maxElement == null
+							|| array[i].compareTo(maxElement) < 0) {
+						maxElement = (T) array[i];
+						maxIndex = i;
+					}
+				}
+			}
+		}
+		return maxIndex;
+	}
+}
Index: /trunk/java-utils/src/main/java/de/ugoe/cs/util/FileTools.java
===================================================================
--- /trunk/java-utils/src/main/java/de/ugoe/cs/util/FileTools.java	(revision 478)
+++ /trunk/java-utils/src/main/java/de/ugoe/cs/util/FileTools.java	(revision 478)
@@ -0,0 +1,88 @@
+package de.ugoe.cs.util;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.nio.charset.Charset;
+
+/**
+ * <p>
+ * Helper class that provides methods that simplify working with files.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class FileTools {
+
+	/**
+	 * <p>
+	 * Private constructor to prevent initializing of the class.
+	 * </p>
+	 */
+	private FileTools() {
+
+	}
+
+	/**
+	 * <p>
+	 * Returns an array of the lines contained in a file. The line separator is
+	 * {@link StringTools#ENDLINE}.
+	 * </p>
+	 * 
+	 * @param filename
+	 *            name of the file
+	 * @return string array, where each line contains a file
+	 * @throws IOException
+	 *             see {@link FileReader#read(char[])},
+	 *             {@link FileReader#close()}
+	 * @throws FileNotFoundException
+	 *             see {@link FileReader#FileReader(File)}
+	 */
+	public static String[] getLinesFromFile(String filename)
+			throws IOException, FileNotFoundException {
+		boolean carriageReturn = true;
+		if( StringTools.ENDLINE.equals("\n") ) {
+			carriageReturn = false;
+		}
+		return getLinesFromFile(filename, carriageReturn);
+	}
+
+	/**
+	 * <p>
+	 * Returns an array of the lines contained in a file.
+	 * </p>
+	 * 
+	 * @param filename
+	 *            name of the file
+	 * @param carriageReturn
+	 *            if true, "\r\n", if false "\n" is used as line separator
+	 * @return string array, where each line contains a file
+	 * @throws IOException
+	 *             see {@link FileReader#read(char[])},
+	 *             {@link FileReader#close()}
+	 * @throws FileNotFoundException
+	 *             see {@link FileReader#FileReader(File)}
+	 */
+	public static String[] getLinesFromFile(String filename,
+			boolean carriageReturn) throws IOException, FileNotFoundException {
+		File f = new File(filename);
+		FileInputStream fis = new FileInputStream(f);
+		InputStreamReader reader = new InputStreamReader(fis,
+				Charset.defaultCharset());
+		char[] buffer = new char[(int) f.length()];
+		reader.read(buffer);
+		reader.close();
+		String splitString;
+		if (carriageReturn) {
+			splitString = "\r\n";
+		} else {
+			splitString = "\n";
+		}
+		return (new String(buffer)).split(splitString);
+	}
+
+}
Index: /trunk/java-utils/src/main/java/de/ugoe/cs/util/StringTools.java
===================================================================
--- /trunk/java-utils/src/main/java/de/ugoe/cs/util/StringTools.java	(revision 478)
+++ /trunk/java-utils/src/main/java/de/ugoe/cs/util/StringTools.java	(revision 478)
@@ -0,0 +1,53 @@
+package de.ugoe.cs.util;
+
+/**
+ * <p>
+ * Helper class that provides methods to simplify working with {@link String}s.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+final public class StringTools {
+
+	/**
+	 * <p>
+	 * Private constructor to prevent initializing of the class.
+	 * </p>
+	 */
+	private StringTools() {
+
+	}
+
+	/**
+	 * <p>
+	 * Simplifies use of operation system specific line separators.
+	 * </p>
+	 */
+	public final static String ENDLINE = System.getProperty("line.separator");
+
+	/**
+	 * <p>
+	 * Replaces all occurrences of {@literal &, <, >, ', and "} with their
+	 * respective XML entities {@literal &amp;, &lt;, &gt;, &apos;, and &quot;}
+	 * without destroying already existing entities.
+	 * </p>
+	 * 
+	 * @param str
+	 *            String where the XML entities are to be replaced
+	 * @return new String, where the XML entities are used instead of the
+	 *         literals
+	 */
+	public static String xmlEntityReplacement(String str) {
+		String result = str;
+		if (result != null && !"".equals(result)) {
+			result = result
+					.replaceAll("&(?!(?:lt|gt|apos|quot|amp);)", "&amp;");
+			result = result.replaceAll("<", "&lt;");
+			result = result.replaceAll(">", "&gt;");
+			result = result.replaceAll("'", "&apos;");
+			result = result.replaceAll("\"", "&quot;");
+		}
+		return result;
+	}
+}
Index: /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/Command.java
===================================================================
--- /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/Command.java	(revision 478)
+++ /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/Command.java	(revision 478)
@@ -0,0 +1,33 @@
+package de.ugoe.cs.util.console;
+
+import java.util.List;
+
+/**
+ * <p>
+ * Defines the interface for a command. The class names of the commands must be
+ * of the form {@code CMD<commandname>}, otherwise they cannot be used by the
+ * {@link CommandExecuter}.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public interface Command {
+
+	/**
+	 * <p>
+	 * Executes a command.
+	 * </p>
+	 * 
+	 * @param parameters
+	 *            parameters for the command.
+	 */
+	public void run(List<Object> parameters);
+
+	/**
+	 * <p>
+	 * Sends information about how to use a command to the console.
+	 * </p>
+	 */
+	public void help();
+}
Index: /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/CommandExecuter.java
===================================================================
--- /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/CommandExecuter.java	(revision 478)
+++ /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/CommandExecuter.java	(revision 478)
@@ -0,0 +1,167 @@
+package de.ugoe.cs.util.console;
+
+import java.security.InvalidParameterException;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * <p>
+ * Executes commands. The commands have to implement the {@link Command}
+ * interface and be in packages registered using addCommandPackage().
+ * Additionally, default commands are implemented in the
+ * de.ugoe.cs.util.console.defaultcommands package.
+ * </p>
+ * <p>
+ * This class is implemented as a <i>Singleton</i>.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class CommandExecuter {
+
+	/**
+	 * <p>
+	 * Handle of the CommandExecuter instance.
+	 * </p>
+	 */
+	private final static CommandExecuter theInstance = new CommandExecuter();
+
+	/**
+	 * <p>
+	 * Prefix of all command classes.
+	 * </p>
+	 */
+	private static final String cmdPrefix = "CMD";
+
+	/**
+	 * <p>
+	 * Name of the package for default commands.
+	 * </p>
+	 */
+	private static final String defaultPackage = "de.ugoe.cs.util.console.defaultcommands";
+
+	/**
+	 * <p>
+	 * List of packages in which commands may be defined. The exec methods trys
+	 * to load command from these packages in the order they have been added.
+	 * </p>
+	 * <p>
+	 * The de.ugoe.cs.util.console.defaultcommands package has always lowest
+	 * priority, unless it is specifically added.
+	 * </p>
+	 */
+	private List<String> commandPackageList;
+
+	/**
+	 * <p>
+	 * Returns the instance of CommandExecuter. If no instances exists yet, a
+	 * new one is created.
+	 * </p>
+	 * 
+	 * @return the instance of CommandExecuter
+	 */
+	public static synchronized CommandExecuter getInstance() {
+		return theInstance;
+	}
+
+	/**
+	 * <p>
+	 * Creates a new CommandExecuter. Private to prevent multiple instances
+	 * (Singleton).
+	 * </p>
+	 */
+	private CommandExecuter() {
+		commandPackageList = new ArrayList<String>();
+	}
+
+	/**
+	 * <p>
+	 * Adds a package that will be used by {@link #exec(String)} to load command
+	 * from.
+	 * </p>
+	 * 
+	 * @param pkg
+	 *            package where commands are located
+	 * @throws InvalidParameterException
+	 *             thrown if the package name is null or empty string
+	 */
+	public void addCommandPackage(String pkg) {
+		if ("".equals(pkg) || pkg == null) {
+			throw new InvalidParameterException(
+					"package name must not be null or empty string");
+		}
+		commandPackageList.add(pkg);
+	}
+
+	/**
+	 * <p>
+	 * Executes the command defined by string. A command has the following form
+	 * (mix of EBNF and natural language):
+	 * </p>
+	 * <code>
+	 * &lt;command&gt; := &lt;commandname&gt;&lt;whitespace&gt;{&lt;parameter&gt;}<br>
+	 * &lt;commandname&gt; := String without whitespaces. Has to be a valid Java class name<br>
+	 * &lt;parameter&gt; := &lt;string&gt;|&lt;stringarray&gt;<br>
+	 * &lt;string&gt; := &lt;stringwithoutwhitespaces&gt;|&lt;stringwithwhitespaces&gt;
+	 * &lt;stringwithoutwhitespaces&gt; := a string without whitespaces<br>
+	 * &lt;stringwithoutwhitespaces&gt; := a string, that can have whitespaces, but must be in double quotes<br>
+	 * &lt;stringarray&gt; := "["&lt;string&gt;{&lt;whitespace&gt;&lt;string&gt;"]"
+	 * </code>
+	 * 
+	 * @param command
+	 *            the command as a string
+	 */
+	public void exec(String command) {
+		Console.commandNotification(command);
+		Command cmd = null;
+		CommandParser parser = new CommandParser();
+		parser.parse(command);
+		for (int i = 0; cmd == null && i < commandPackageList.size(); i++) {
+			cmd = loadCMD(commandPackageList.get(i) + "." + cmdPrefix
+					+ parser.getCommandName());
+		}
+		if (cmd == null) { // check if command is available as default command
+			cmd = loadCMD(defaultPackage + "." + cmdPrefix
+					+ parser.getCommandName());
+		}
+		if (cmd == null) {
+			Console.println("Unknown command");
+		} else {
+			try {
+				cmd.run(parser.getParameters());
+			} catch (InvalidParameterException e) {
+				cmd.help();
+			}
+		}
+	}
+
+	/**
+	 * <p>
+	 * Helper method that loads a class and tries to cast it to {@link Command}.
+	 * </p>
+	 * 
+	 * @param className
+	 *            qualified name of the class (including package name)
+	 * @return if class is available and implement {@link Command} and instance
+	 *         of the class, null otherwise
+	 */
+	private Command loadCMD(String className) {
+		Command cmd = null;
+		try {
+			Class<?> cmdClass = Class.forName(className);
+			cmd = (Command) cmdClass.newInstance();
+		} catch (NoClassDefFoundError e) {
+			String[] splitResult = e.getMessage().split("CMD");
+			String correctName = splitResult[splitResult.length - 1].replace(
+					")", "");
+			Console.println("Did you mean " + correctName + "?");
+		} catch (ClassNotFoundException e) {
+		} catch (IllegalAccessException e) {
+		} catch (InstantiationException e) {
+		} catch (ClassCastException e) {
+			Console.traceln(className + "found, but does not implement Command");
+		}
+		return cmd;
+	}
+}
Index: /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/CommandParser.java
===================================================================
--- /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/CommandParser.java	(revision 478)
+++ /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/CommandParser.java	(revision 478)
@@ -0,0 +1,200 @@
+package de.ugoe.cs.util.console;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * <p>
+ * Helper class to parse command strings and create parameters.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class CommandParser {
+
+	/**
+	 * <p>
+	 * Name of the command.
+	 * </p>
+	 */
+	private String commandName;
+
+	/**
+	 * <p>
+	 * Parameters of the command as a {@link List}. The parameters can either be
+	 * {@link String} or {@link String} arrays.
+	 * </p>
+	 */
+	private List<Object> parameters;
+
+	/**
+	 * <p>
+	 * Creates a new CommandParser.
+	 * </p>
+	 */
+	public CommandParser() {
+		commandName = "";
+		parameters = new ArrayList<Object>();
+	}
+
+	/**
+	 * <p>
+	 * Returns the name of the command.
+	 * </p>
+	 * 
+	 * @return name of the command
+	 */
+	public String getCommandName() {
+		return commandName;
+	}
+
+	/**
+	 * <p>
+	 * Returns the {@link List} of parameters
+	 * </p>
+	 * 
+	 * @return {@link List} of parameters that were parsed.
+	 */
+	public List<Object> getParameters() {
+		return parameters;
+	}
+
+	/**
+	 * <p>
+	 * Parses a command after the following EBNF (mixed with natural language):
+	 * </p>
+	 * <code>
+	 * &lt;command&gt; :=
+	 * &lt;commandname&gt;&lt;whitespace&gt;{&lt;parameter&gt;}<br>
+	 * &lt;commandname&gt; := String without whitespaces. Has to be a valid Java
+	 * class name<br>
+	 * &lt;parameter&gt; := &lt;string&gt;|&lt;stringarray&gt;<br>
+	 * &lt;string&gt; :=
+	 * &lt;stringwithoutwhitespaces&gt;|&lt;stringwithwhitespaces&gt;
+	 * &lt;stringwithoutwhitespaces&gt; := a string without whitespaces<br>
+	 * &lt;stringwithoutwhitespaces&gt; := a string, that can have whitespaces,
+	 * but must be in double quotes<br>
+	 * &lt;stringarray&gt; :=
+	 * "["&lt;string&gt;{&lt;whitespace&gt;&lt;string&gt;"]"
+	 * </code>
+	 * 
+	 * @param command
+	 *            the command as a string
+	 */
+	public void parse(String command) {
+		if (command == null || command.equals("")) {
+			return;
+		}
+		String[] splitResult = command.split(" ");
+		commandName = splitResult[0];
+		char[] commandChars = command.substring(commandName.length())
+				.toCharArray();
+		boolean startParameter = true;
+		boolean isArray = false;
+		boolean startArrayparameter = false;
+		boolean isString = false;
+		int bufferPos = 0;
+		char[] buffer = new char[1024];
+		boolean quote = false;
+		List<String> arrayBuffer = null;
+		for (int i = 0; i < commandChars.length; i++) {
+			if (i < commandChars.length && startParameter
+					&& commandChars[i] == '[') {
+				isArray = true;
+				startArrayparameter = true;
+				arrayBuffer = new ArrayList<String>();
+				startParameter = false;
+				i++; // skip [
+			}
+			if (i < commandChars.length && startParameter
+					&& commandChars[i] == '\'') {
+				isString = true;
+				quote = true;
+				startParameter = false;
+				i++; // skip '
+			}
+			if (i < commandChars.length && startParameter
+					&& !Character.isWhitespace(commandChars[i])) {
+				isString = true;
+				startParameter = false;
+			}
+			if (isArray) {
+				if (i < commandChars.length && commandChars[i] == ']') {
+					if (bufferPos > 0) {
+						buffer[bufferPos] = '\0';
+						arrayBuffer.add((new String(buffer)).trim());
+					}
+					parameters.add(arrayBuffer.toArray(new String[0]));
+					isArray = false;
+					isString = false;
+					bufferPos = 0;
+					buffer = new char[128];
+					startArrayparameter = false;
+					startParameter = true;
+					i++; // skip ]
+				}
+				if (i < commandChars.length && startArrayparameter
+						&& !Character.isWhitespace(commandChars[i])) {
+					buffer = new char[128];
+					bufferPos = 0;
+					quote = commandChars[i] == '\'';
+					if (quote) {
+						i++; // skip '
+					}
+					startArrayparameter = false;
+				}
+				if (i < commandChars.length && quote && !startArrayparameter && commandChars[i] == '\'') {
+					// end of parameter with '
+					i++; // skip '
+					startArrayparameter = true;
+					buffer[bufferPos] = '\0';
+					arrayBuffer.add((new String(buffer)).trim());
+				}
+				if (i < commandChars.length && !quote && !startArrayparameter
+						&& Character.isWhitespace(commandChars[i])) {
+					startArrayparameter = true;
+					buffer[bufferPos] = '\0';
+					arrayBuffer.add((new String(buffer)).trim());
+				}
+				if (i < commandChars.length && !startArrayparameter
+						&& !startParameter) {
+					buffer[bufferPos] = commandChars[i];
+					bufferPos++;
+				}
+			}
+			if (isString) {
+				if ((quote && commandChars[i] == '\'')
+						|| (!quote && Character.isWhitespace(commandChars[i]))) {
+					// end of parameter with '
+					if (quote) {
+						i++; // skip '
+					}
+					if (bufferPos > 0) {
+						buffer[bufferPos] = '\0';
+					}
+					parameters.add((new String(buffer).trim()));
+					isArray = false;
+					isString = false;
+					bufferPos = 0;
+					buffer = new char[128];
+					startArrayparameter = false;
+					startParameter = true;
+				}
+				if (!startParameter) {
+					buffer[bufferPos] = commandChars[i];
+					bufferPos++;
+				}
+			}
+		}
+		if (bufferPos > 0) {
+			if (isArray) {
+				//arrayBuffer.add((new String(buffer)).trim());
+				parameters.add(arrayBuffer.toArray(new String[0]));
+			}
+			if (isString) {
+				parameters.add((new String(buffer)).trim());
+			}
+		}
+	}
+}
Index: /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/Console.java
===================================================================
--- /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/Console.java	(revision 478)
+++ /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/Console.java	(revision 478)
@@ -0,0 +1,457 @@
+package de.ugoe.cs.util.console;
+
+import java.util.Collection;
+import java.util.LinkedHashSet;
+
+import de.ugoe.cs.util.StringTools;
+import de.ugoe.cs.util.console.listener.ICommandListener;
+import de.ugoe.cs.util.console.listener.IErrorListener;
+import de.ugoe.cs.util.console.listener.IExceptionListener;
+import de.ugoe.cs.util.console.listener.IOutputListener;
+import de.ugoe.cs.util.console.listener.ITraceListener;
+
+/**
+ * <p>
+ * This class provides an interface for communication with the user without have
+ * to rely on a specific user interface. Thus, it can be used to decouple the
+ * programs logic from its user interface.
+ * </p>
+ * <p>
+ * {@link Command} objects can be used to execute behavior.
+ * </p>
+ * <p>
+ * To send output to the user interface, the Observer pattern is used. The
+ * Console is an observable, the concrete user interfaces are the observers. The
+ * interface for the observers is {@link ConsoleObserver}.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public final class Console {
+
+	/**
+	 * <p>
+	 * Listeners for the output stream.
+	 * </p>
+	 */
+	private Collection<IOutputListener> outputListener;
+
+	/**
+	 * <p>
+	 * Listeners for the error stream.
+	 * </p>
+	 */
+	private Collection<IErrorListener> errorListener;
+
+	/**
+	 * <p>
+	 * Listeners for the trace stream.
+	 * </p>
+	 */
+	private Collection<ITraceListener> traceListener;
+
+	/**
+	 * <p>
+	 * Listeners for the command stream.
+	 * </p>
+	 */
+	private Collection<ICommandListener> commandListener;
+
+	/**
+	 * <p>
+	 * Listeners for the exception stream.
+	 * </p>
+	 */
+	private Collection<IExceptionListener> exceptionListener;
+
+	/**
+	 * <p>
+	 * Handle of the Console instance.
+	 * </p>
+	 */
+	private static Console theInstance = new Console();
+
+	/**
+	 * <p>
+	 * Returns the instance of Console. If no instances exists yet, a new one is
+	 * created.
+	 * </p>
+	 * 
+	 * @return instance of this class
+	 */
+	public static Console getInstance() {
+		return theInstance;
+	}
+
+	/**
+	 * <p>
+	 * Resets the Console by creating a new instance that has no registered
+	 * observers.
+	 * </p>
+	 */
+	public static void reset() {
+		theInstance.init();
+	}
+
+	/**
+	 * <p>
+	 * Creates a new Console. Private to prevent multiple instances (Singleton).
+	 * </p>
+	 */
+	private Console() {
+		init();
+	}
+
+	/**
+	 * <p>
+	 * Initializes the console.
+	 * </p>
+	 */
+	private void init() {
+		outputListener = new LinkedHashSet<IOutputListener>();
+		errorListener = new LinkedHashSet<IErrorListener>();
+		traceListener = new LinkedHashSet<ITraceListener>();
+		commandListener = new LinkedHashSet<ICommandListener>();
+		exceptionListener = new LinkedHashSet<IExceptionListener>();
+	}
+
+	/**
+	 * <p>
+	 * Register a new observer.
+	 * </p>
+	 * 
+	 * @deprecated use registerXYZListener instead
+	 * @param observer
+	 *            observer to be added
+	 */
+	public void registerObserver(ConsoleObserver observer) {
+		registerOutputListener(observer);
+		registerErrorListener(observer);
+		registerTraceListener(observer);
+		registerCommandListener(observer);
+		registerExceptionListener(observer);
+	}
+
+	/**
+	 * <p>
+	 * Registers an output listener.
+	 * </p>
+	 * 
+	 * @param listener
+	 *            listener that is registered
+	 */
+	public void registerOutputListener(IOutputListener listener) {
+		outputListener.add(listener);
+	}
+
+	/**
+	 * <p>
+	 * Registers an error listener.
+	 * </p>
+	 * 
+	 * @param listener
+	 *            listener that is registered
+	 */
+	public void registerErrorListener(IErrorListener listener) {
+		errorListener.add(listener);
+	}
+
+	/**
+	 * <p>
+	 * Registers a trace listener.
+	 * </p>
+	 * 
+	 * @param listener
+	 *            listener that is registered
+	 */
+	public void registerTraceListener(ITraceListener listener) {
+		traceListener.add(listener);
+	}
+
+	/**
+	 * <p>
+	 * Registers a command listener.
+	 * </p>
+	 * 
+	 * @param listener
+	 *            listener that is registered
+	 */
+	public void registerCommandListener(ICommandListener listener) {
+		commandListener.add(listener);
+	}
+
+	/**
+	 * <p>
+	 * Registers an exception listener.
+	 * </p>
+	 * 
+	 * @param listener
+	 *            listener that is registered
+	 */
+	public void registerExceptionListener(IExceptionListener listener) {
+		exceptionListener.add(listener);
+	}
+
+	/**
+	 * <p>
+	 * Remove an observer. If the observer is not found, nothing is done.
+	 * </p>
+	 * 
+	 * @deprecated use removeXYZListener instead
+	 * @param observer
+	 *            observer to be removed
+	 */
+	public void deleteObserver(ConsoleObserver observer) {
+		removeOutputListener(observer);
+		removeErrorListener(observer);
+		removeTraceListener(observer);
+		removeCommandListener(observer);
+		removeExceptionListener(observer);
+	}
+
+	/**
+	 * <p>
+	 * Removes an output listener.
+	 * </p>
+	 * 
+	 * @param listener
+	 *            listener that is removed
+	 */
+	public void removeOutputListener(IOutputListener listener) {
+		outputListener.remove(listener);
+	}
+
+	/**
+	 * <p>
+	 * Removes an error listener.
+	 * </p>
+	 * 
+	 * @param listener
+	 *            listener that is removed
+	 */
+	public void removeErrorListener(IErrorListener listener) {
+		errorListener.remove(listener);
+	}
+
+	/**
+	 * <p>
+	 * Removes an trace listener.
+	 * </p>
+	 * 
+	 * @param listener
+	 *            listener that is removed
+	 */
+	public void removeTraceListener(ITraceListener listener) {
+		traceListener.remove(listener);
+	}
+
+	/**
+	 * <p>
+	 * Removes a command listener.
+	 * </p>
+	 * 
+	 * @param listener
+	 *            listener that is removed
+	 */
+	public void removeCommandListener(ICommandListener listener) {
+		commandListener.remove(listener);
+	}
+
+	/**
+	 * <p>
+	 * Removes an exception listener.
+	 * </p>
+	 * 
+	 * @param listener
+	 *            listener that is removed
+	 */
+	public void removeExceptionListener(IExceptionListener listener) {
+		exceptionListener.remove(listener);
+	}
+
+	/**
+	 * <p>
+	 * Checks if a listener is registered.
+	 * </p>
+	 * 
+	 * @param listener
+	 *            listener that is checked
+	 * @return true, is listener is registered; false, otherwise
+	 */
+	public boolean hasOutputListener(IOutputListener listener) {
+		return outputListener.contains(listener);
+	}
+
+	/**
+	 * <p>
+	 * Checks if a listener is registered.
+	 * </p>
+	 * 
+	 * @param listener
+	 *            listener that is checked
+	 * @return true, is listener is registered; false, otherwise
+	 */
+	public boolean hasErrorListener(IErrorListener listener) {
+		return errorListener.contains(listener);
+	}
+
+	/**
+	 * <p>
+	 * Checks if a listener is registered.
+	 * </p>
+	 * 
+	 * @param listener
+	 *            listener that is checked
+	 * @return true, is listener is registered; false, otherwise
+	 */
+	public boolean hasTraceListener(ITraceListener listener) {
+		return traceListener.contains(listener);
+	}
+
+	/**
+	 * <p>
+	 * Checks if a listener is registered.
+	 * </p>
+	 * 
+	 * @param listener
+	 *            listener that is checked
+	 * @return true, is listener is registered; false, otherwise
+	 */
+	public boolean hasCommandListener(ICommandListener listener) {
+		return commandListener.contains(listener);
+	}
+
+	/**
+	 * <p>
+	 * Checks if a listener is registered.
+	 * </p>
+	 * 
+	 * @param listener
+	 *            listener that is checked
+	 * @return true, is listener is registered; false, otherwise
+	 */
+	public boolean hasExceptionListener(IExceptionListener listener) {
+		return exceptionListener.contains(listener);
+	}
+
+	/**
+	 * <p>
+	 * Sends a message to all observers containing the message that was passed
+	 * to this function.
+	 * </p>
+	 * 
+	 * @param msg
+	 *            message that is send to the console
+	 */
+	public static void print(String msg) {
+		for (IOutputListener observer : theInstance.outputListener) {
+			observer.outputMsg(msg);
+		}
+	}
+
+	/**
+	 * <p>
+	 * Sends a message to all observers containing the message that was passed
+	 * to this function and adds an endline to the message.
+	 * </p>
+	 * 
+	 * @param msg
+	 *            message that is send to the observers
+	 */
+	public static void println(String msg) {
+		for (IOutputListener observer : theInstance.outputListener) {
+			observer.outputMsg(msg + StringTools.ENDLINE);
+		}
+	}
+
+	/**
+	 * <p>
+	 * Sends an error message to all observers containing the message that was
+	 * passed to this function.
+	 * </p>
+	 * 
+	 * @param errMsg
+	 *            message that is send to the observers
+	 */
+	public static void printerr(String errMsg) {
+		for (IErrorListener observer : theInstance.errorListener) {
+			observer.errorMsg(errMsg);
+		}
+	}
+
+	/**
+	 * <p>
+	 * Sends an error message to all observers containing the message that was
+	 * passed to this function and adds an endline to the message.
+	 * </p>
+	 * 
+	 * @param errMsg
+	 *            message that is send to the observers
+	 */
+	public static void printerrln(String errMsg) {
+		for (IErrorListener observer : theInstance.errorListener) {
+			observer.errorMsg(errMsg + StringTools.ENDLINE);
+		}
+	}
+
+	/**
+	 * <p>
+	 * Sends an exception to all observers to print its stack trace.
+	 * </p>
+	 * 
+	 * @param e
+	 *            exception whose stack trace is to be printed
+	 */
+	public static void logException(Exception e) {
+		for (IExceptionListener observer : theInstance.exceptionListener) {
+			observer.logException(e);
+		}
+	}
+
+	/**
+	 * <p>
+	 * Sends a debug message to all observers containing the message that was
+	 * passed to this function.
+	 * </p>
+	 * 
+	 * @param traceMsg
+	 *            message that is send to the observers
+	 */
+	public static void trace(String traceMsg) {
+		for (ITraceListener observer : theInstance.traceListener) {
+			observer.traceMsg(traceMsg);
+		}
+	}
+
+	/**
+	 * <p>
+	 * Sends a debug message to all observers containing the message that was
+	 * passed to this function and adds an {@link StringTools#ENDLINE} to the
+	 * message.
+	 * </p>
+	 * 
+	 * @param traceMsg
+	 *            message that is send to the observers
+	 */
+	public static void traceln(String traceMsg) {
+		for (ITraceListener observer : theInstance.traceListener) {
+			observer.traceMsg(traceMsg + StringTools.ENDLINE);
+		}
+	}
+
+	/**
+	 * <p>
+	 * Called by {@link CommandExecuter#exec(String)}.
+	 * </p>
+	 * 
+	 * @param command
+	 *            command that is executed
+	 */
+	static void commandNotification(String command) {
+		for (ICommandListener observer : theInstance.commandListener) {
+			observer.commandNotification(command);
+		}
+	}
+
+}
Index: /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/ConsoleObserver.java
===================================================================
--- /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/ConsoleObserver.java	(revision 478)
+++ /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/ConsoleObserver.java	(revision 478)
@@ -0,0 +1,20 @@
+package de.ugoe.cs.util.console;
+
+import de.ugoe.cs.util.console.listener.ICommandListener;
+import de.ugoe.cs.util.console.listener.IErrorListener;
+import de.ugoe.cs.util.console.listener.IExceptionListener;
+import de.ugoe.cs.util.console.listener.IOutputListener;
+import de.ugoe.cs.util.console.listener.ITraceListener;
+
+/**
+ * <p>
+ * Observer for Console.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 2.0
+ * @deprecated Use listeners defined in the package de.ugoe.cs.console.listeners instead.
+ */
+public interface ConsoleObserver extends ITraceListener, IOutputListener, IErrorListener, ICommandListener, IExceptionListener {
+
+}
Index: /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/FileOutputListener.java
===================================================================
--- /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/FileOutputListener.java	(revision 478)
+++ /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/FileOutputListener.java	(revision 478)
@@ -0,0 +1,126 @@
+package de.ugoe.cs.util.console;
+
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+
+import de.ugoe.cs.util.console.listener.IOutputListener;
+
+/**
+ * <p>
+ * Implements an {@link IOutputListener} for the {@link Console} that logs all
+ * outputs in a file. This can be used to "pipe" the output-stream of the
+ * console into a file. The advantage of using this mechanism for piping is that
+ * the file will only contain the output stream. No errors, no commands, etc.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class FileOutputListener implements IOutputListener {
+
+	/**
+	 * <p>
+	 * Flag that ensures that only one log message is produced if the listener
+	 * breaks, e.g., because of a full hard disk/quota.
+	 * </p>
+	 */
+	boolean failureLogged = false;
+
+	/**
+	 * <p>
+	 * Name of the output file.
+	 * </p>
+	 */
+	String filename;
+
+	/**
+	 * <p>
+	 * Writer for the output.
+	 * </p>
+	 */
+	OutputStreamWriter writer = null;
+
+	/**
+	 * <p>
+	 * Constructor. Creates a new FileOutputListener.
+	 * </p>
+	 * 
+	 * @param filename
+	 *            name and path of the file the listener writes to.
+	 */
+	public FileOutputListener(String filename) {
+		this.filename = filename;
+
+	}
+
+	/**
+	 * <p>
+	 * Starts the listener by opening the file and registering it with the
+	 * {@link Console}.
+	 * </p>
+	 */
+	public void start() {
+		try {
+			FileOutputStream fos = new FileOutputStream(filename);
+			writer = new OutputStreamWriter(fos, "UTF-8");
+			Console.getInstance().registerOutputListener(this);
+		} catch (IOException e) {
+			Console.printerrln("Failed to start FileOutputListener for file "
+					+ filename + ": " + e.getMessage());
+		}
+	}
+
+	/**
+	 * <p>
+	 * Stops the listener by closing the file and removing itself from the
+	 * {@link Console}.
+	 * </p>
+	 */
+	public void stop() {
+		Console.getInstance().removeOutputListener(this);
+		if( writer!=null ) {
+			try {
+				writer.close();
+				writer = null;
+			} catch (IOException e) {
+				Console.printerrln("Failed to close file " + filename + ": "
+						+ e.getMessage());
+			}
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * de.ugoe.cs.util.console.listener.IOutputListener#outputMsg(java.lang.
+	 * String)
+	 */
+	@Override
+	public void outputMsg(String newMessage) {
+		if( writer!=null ) {
+			try {
+				writer.write(newMessage);
+			} catch (IOException e) {
+				if (!failureLogged) {
+					Console.printerrln("FileOutpustListener for file " + filename
+							+ " broken: " + e.getMessage());
+					failureLogged = true;
+				}
+			}
+		}
+	}
+
+	/**
+	 * <p>
+	 * Returns the name of the log file used by this listener.
+	 * </p>
+	 * 
+	 * @return name of the log file
+	 */
+	public String getFilename() {
+		return filename;
+	}
+
+}
Index: /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/TextConsole.java
===================================================================
--- /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/TextConsole.java	(revision 478)
+++ /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/TextConsole.java	(revision 478)
@@ -0,0 +1,149 @@
+package de.ugoe.cs.util.console;
+
+import java.io.IOException;
+import java.nio.charset.Charset;
+
+import de.ugoe.cs.util.console.listener.IErrorListener;
+import de.ugoe.cs.util.console.listener.IExceptionListener;
+import de.ugoe.cs.util.console.listener.IOutputListener;
+import de.ugoe.cs.util.console.listener.ITraceListener;
+
+/**
+ * <p>
+ * Implements a simple console observer that prints normal text to
+ * {@code stdout}, errors to {@code stderr} and reads from {@code stdin}.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class TextConsole implements IOutputListener, IErrorListener,
+		ITraceListener, IExceptionListener {
+
+	/**
+	 * <p>
+	 * In the debug mode, trace messages will be printed.
+	 * </p>
+	 */
+	private boolean debugMode = true;
+
+	/**
+	 * <p>
+	 * Creates a new text console and automatically registers it as observer.
+	 * </p>
+	 */
+	public TextConsole() {
+		Console.getInstance().registerOutputListener(this);
+		Console.getInstance().registerErrorListener(this);
+		Console.getInstance().registerTraceListener(this);
+		Console.getInstance().registerExceptionListener(this);
+	}
+
+	/**
+	 * <p>
+	 * Prints messages to {@code stdout}.
+	 * </p>
+	 * 
+	 * @see ConsoleObserver#outputMsg(java.lang.String)
+	 */
+	public void outputMsg(String newMessage) {
+		System.out.print(newMessage);
+	}
+
+	/**
+	 * <p>
+	 * Prints messages to {@code stderr}.
+	 * </p>
+	 * 
+	 * @see ConsoleObserver#errorMsg(String)
+	 */
+	@Override
+	public void errorMsg(String errMessage) {
+		System.err.print(errMessage);
+	}
+
+	/**
+	 * <p>
+	 * Prints the stacktrace of an exception to {@code stderr}.
+	 * </p>
+	 * 
+	 * @see ConsoleObserver#logException(Exception)
+	 */
+	@Override
+	public void logException(Exception e) {
+		System.err.println(e.getMessage());
+	}
+
+	/**
+	 * <p>
+	 * Prints messages to {@code stdout}. These messages are only printed, if
+	 * the console is run in debug mode.
+	 * </p>
+	 */
+	@Override
+	public void traceMsg(String traceMessage) {
+		if (debugMode) {
+			System.out.print(traceMessage);
+		}
+	}
+
+	/**
+	 * <p>
+	 * Starts a new TextConsole. If the text console is started, it can be used
+	 * not only to print message, but also to execute commands by reading
+	 * {@code stdin}.
+	 * </p>
+	 * 
+	 * @param debugMode
+	 *            true, if the application is to run in debug mode, i.e. trace
+	 *            messages will be printed
+	 */
+	public void run(boolean debugMode) {
+		this.debugMode = debugMode;
+		CommandExecuter exec = CommandExecuter.getInstance();
+		while (true) {
+			System.out.print("> ");
+			String command = getCommand().trim();
+			if (!command.equals("")) {
+				exec.exec(command);
+			}
+		}
+	}
+
+	/**
+	 * <p>
+	 * Reads a new command from {@code stdin}.
+	 * </p>
+	 * 
+	 * @return a string with a command
+	 */
+	protected String getCommand() {
+		byte[] buffer = new byte[1024];
+		int bytesRead = 0;
+		String command;
+		try {
+			bytesRead = System.in.read(buffer);
+		} catch (IOException e) {
+
+		}
+		if (bytesRead == 0) {
+			command = "";
+		} else {
+			command = new String(buffer, Charset.defaultCharset());
+		}
+		return command;
+	}
+
+	/**
+	 * <p>
+	 * Configures if the debug mode of the text console is enabled.
+	 * </p>
+	 * 
+	 * @param debug
+	 *            if true, debug mode is enabled.
+	 */
+	public void setDebug(boolean debug) {
+		debugMode = debug;
+	}
+
+}
Index: /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/defaultcommands/CMDexec.java
===================================================================
--- /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/defaultcommands/CMDexec.java	(revision 478)
+++ /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/defaultcommands/CMDexec.java	(revision 478)
@@ -0,0 +1,67 @@
+package de.ugoe.cs.util.console.defaultcommands;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.security.InvalidParameterException;
+import java.util.List;
+
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.CommandExecuter;
+import de.ugoe.cs.util.console.Console;
+
+/**
+ * <p>
+ * Command to execute a batch of {@link Command}s. The batch is defined as a
+ * text file, where each line defines one command.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class CMDexec implements Command {
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#run(java.util.List)
+	 */
+	public void run(List<Object> parameters) {
+		String script;
+		try {
+			script = (String) parameters.get(0);
+		} catch (Exception e) {
+			throw new InvalidParameterException();
+		}
+		try {
+			String[] commands;
+			File f = new File(script);
+			FileInputStream fis = new FileInputStream(f);
+			InputStreamReader reader = new InputStreamReader(fis, "UTF-8");
+			char[] buffer = new char[(int) f.length()];
+			reader.read(buffer);
+			commands = (new String(buffer)).split("\n");
+			for (String command : commands) {
+				Console.traceln(command.trim());
+				CommandExecuter.getInstance().exec(command);
+			}
+			reader.close();
+		} catch (FileNotFoundException e) {
+			Console.printerrln(e.getMessage());
+		} catch (IOException e) {
+			Console.printerrln(e.getMessage());
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see databasebuilder.console.commands.Command#help()
+	 */
+	@Override
+	public void help() {
+		Console.println("Usage: exec <filename>");
+	}
+}
Index: /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/defaultcommands/CMDexit.java
===================================================================
--- /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/defaultcommands/CMDexit.java	(revision 478)
+++ /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/defaultcommands/CMDexit.java	(revision 478)
@@ -0,0 +1,38 @@
+package de.ugoe.cs.util.console.defaultcommands;
+
+import java.util.List;
+
+import de.ugoe.cs.util.console.Command;
+import de.ugoe.cs.util.console.Console;
+
+/**
+ * <p>
+ * Command to terminate an application.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public class CMDexit implements Command {
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see databasebuilder.console.commands.Command#help()
+	 */
+	@Override
+	public void help() {
+		Console.println("Usage: exit");
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see de.ugoe.cs.util.console.Command#run(java.util.List)
+	 */
+	@Override
+	public void run(List<Object> parameters) {
+		System.exit(0);
+	}
+
+}
Index: /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/listener/ICommandListener.java
===================================================================
--- /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/listener/ICommandListener.java	(revision 478)
+++ /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/listener/ICommandListener.java	(revision 478)
@@ -0,0 +1,25 @@
+package de.ugoe.cs.util.console.listener;
+
+import de.ugoe.cs.util.console.CommandExecuter;
+
+/**
+ * <p>
+ * Interface for listeners observing the commands executed by the
+ * {@link CommandExecuter}.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public interface ICommandListener {
+	/**
+	 * <p>
+	 * Receives the command strings of all executed by the
+	 * {@link CommandExecuter}.
+	 * </p>
+	 * 
+	 * @param command
+	 *            string of the command.
+	 */
+	public void commandNotification(String command);
+}
Index: /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/listener/IErrorListener.java
===================================================================
--- /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/listener/IErrorListener.java	(revision 478)
+++ /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/listener/IErrorListener.java	(revision 478)
@@ -0,0 +1,24 @@
+package de.ugoe.cs.util.console.listener;
+
+import de.ugoe.cs.util.console.Console;
+
+/**
+ * <p>
+ * Interface for listeners observing the error stream of the {@link Console}.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public interface IErrorListener {
+
+	/**
+	 * <p>
+	 * Receives messages send to the error stream of the {@link Console}.
+	 * </p>
+	 * 
+	 * @param errMessage
+	 *            error message
+	 */
+	public void errorMsg(String errMessage);
+}
Index: /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/listener/IExceptionListener.java
===================================================================
--- /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/listener/IExceptionListener.java	(revision 478)
+++ /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/listener/IExceptionListener.java	(revision 478)
@@ -0,0 +1,24 @@
+package de.ugoe.cs.util.console.listener;
+
+import de.ugoe.cs.util.console.Console;
+
+/**
+ * <p>
+ * Received all exceptions passed to the {@link Console} for logging.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public interface IExceptionListener {
+
+	/**
+	 * <p>
+	 * Logs an exception passed to the {@link Console}.
+	 * </p>
+	 * 
+	 * @param e
+	 *            Exception that is logged
+	 */
+	public void logException(Exception e);
+}
Index: /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/listener/IOutputListener.java
===================================================================
--- /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/listener/IOutputListener.java	(revision 478)
+++ /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/listener/IOutputListener.java	(revision 478)
@@ -0,0 +1,25 @@
+package de.ugoe.cs.util.console.listener;
+
+import de.ugoe.cs.util.console.Console;
+
+/**
+ * <p>
+ * Interface for listeners observing the output stream of the {@link Console}.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public interface IOutputListener {
+
+	/**
+	 * <p>
+	 * Receives messages send to the output stream of the {@link Console}.
+	 * </p>
+	 * 
+	 * @param newMessage
+	 *            message that was send to the console.
+	 */
+	public void outputMsg(String newMessage);
+
+}
Index: /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/listener/ITraceListener.java
===================================================================
--- /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/listener/ITraceListener.java	(revision 478)
+++ /trunk/java-utils/src/main/java/de/ugoe/cs/util/console/listener/ITraceListener.java	(revision 478)
@@ -0,0 +1,23 @@
+package de.ugoe.cs.util.console.listener;
+
+import de.ugoe.cs.util.console.Console;
+
+/**
+ * <p>
+ * Interface for listeners observing traces stream to the {@link Console}.
+ * </p>
+ * 
+ * @author Steffen Herbold
+ * @version 1.0
+ */
+public interface ITraceListener {
+	/**
+	 * <p>
+	 * Receives messages send to the trace stream of the {@link Console}.
+	 * </p>
+	 * 
+	 * @param traceMessage
+	 *            error message
+	 */
+	public void traceMsg(String traceMessage);
+}
