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 1355)
+++ trunk/java-utils/src/main/java/de/ugoe/cs/util/FileTools.java	(revision 1451)
@@ -15,8 +15,10 @@
 package de.ugoe.cs.util;
 
+import java.io.BufferedWriter;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.FileReader;
+import java.io.FileWriter;
 import java.io.IOException;
 import java.io.InputStreamReader;
@@ -99,9 +101,47 @@
         return (new String(buffer)).split(splitString);
     }
-    
+
     /**
      * <p>
-     * Autocompletes a give path. The path must be absolute. Otherwise, autocompletion
-     * is not possible.
+     * Writes an array to a file using the toString function of its object.
+     * </p>
+     * 
+     * @param array
+     *            array that is written
+     * @param filename
+     *            name of the output file
+     * @param separator
+     *            separator string that is put between the array objects
+     * @param lineBreak
+     *            if true, a new line is added after each array element and its separator
+     * @throws IOException
+     *             see {@link BufferedWriter#write(String)}, {@link BufferedWriter#newLine()},
+     *             {@link BufferedWriter#flush()}, {@link BufferedWriter#close()},
+     *             {@link FileWriter#FileWriter(String)}
+     */
+    public static <T> void writeArrayToFile(T[] array,
+                                            String filename,
+                                            String separator,
+                                            boolean lineBreak) throws IOException
+    {
+        BufferedWriter outputWriter = null;
+        outputWriter = new BufferedWriter(new FileWriter(filename));
+        for (int i = 0; i < array.length; i++) {
+            outputWriter.write(array[i].toString());
+            if (i < array.length - 1) {
+                outputWriter.write(separator);
+                if (lineBreak) {
+                    outputWriter.newLine();
+                }
+            }
+        }
+        outputWriter.flush();
+        outputWriter.close();
+    }
+
+    /**
+     * <p>
+     * Autocompletes a given path. The path must be absolute. Otherwise, autocompletion is not
+     * possible.
      * </p>
      * 
@@ -113,5 +153,5 @@
         File prefixFile = new File(prefix);
         File parentDir = prefixFile.getParentFile();
-        
+
         if (parentDir == null) {
             // the prefix does not denote a path or denotes one of the root directories.
@@ -119,21 +159,21 @@
             return prefix;
         }
-        
+
         String[] completions = null;
-        
+
         if (parentDir.exists()) {
             completions = parentDir.list();
         }
-        
+
         if (completions == null) {
             completions = new String[0];
         }
-        
+
         String completedPrefix;
-        
+
         completedPrefix = StringTools.autocomplete(prefixFile.getName(), completions);
-        
+
         File completedFile = new File(parentDir, completedPrefix);
-        
+
         if (completedFile.exists() && completedFile.isDirectory()) {
             return completedFile.getAbsolutePath() + File.separator;
