Index: /FCKeditor.Java/branches/2.4/src/main/java/net/fckeditor/tool/Utils.java
===================================================================
--- /FCKeditor.Java/branches/2.4/src/main/java/net/fckeditor/tool/Utils.java	(revision 1413)
+++ /FCKeditor.Java/branches/2.4/src/main/java/net/fckeditor/tool/Utils.java	(revision 1414)
@@ -29,126 +29,136 @@
 /**
  * Some static helper methods.
- * 
- * @author <a href="mailto:th-schwarz@users.sourceforge.net">Thilo Schwarz</a>
+ *
+ * @version $Id$
  */
 public class Utils {
 
-    /**
-     * Constructs a set of uppercased strings from a 'delimiter' separated string.
-     * 
-     * @param stringList
-     * @param delimiter
-     *                The delimiter. It shouldn't be empty!
-     * @return An emtpy list, if 'stringList' is empty, or an uppercased set of strings.
-     * @throws IllegalArgumentException
-     *                 if 'delimiter' is empty.
-     */
-    public static Set<String> getSet(final String stringList, final String delimiter) {
-	if (isEmpty(delimiter))
-	    throw new IllegalArgumentException("Argument 'delimiter' shouldn't be empty!");
-	if (stringList == null || isEmpty(stringList))
-	    return new HashSet<String>();
+	/**
+	 * Constructs a set of uppercased strings from a 'delimiter' separated string.
+	 * 
+	 * @param stringList
+	 * @param delimiter
+	 *          The delimiter. It shouldn't be empty!
+	 * @return An emtpy list, if 'stringList' is empty, or an uppercased set of strings.
+	 * @throws IllegalArgumentException
+	 *           if 'delimiter' is empty.
+	 */
+	public static Set<String> getSet(final String stringList, final String delimiter) {
+		if (isEmpty(delimiter))
+			throw new IllegalArgumentException("Argument 'delimiter' shouldn't be empty!");
+		if (stringList == null || isEmpty(stringList))
+			return new HashSet<String>();
 
-	Set<String> set = new HashSet<String>();
-	StringTokenizer st = new StringTokenizer(stringList, delimiter);
-	while (st.hasMoreTokens()) {
-	    String tmp = st.nextToken();
-	    if (isNotEmpty(tmp)) // simple empty filter
-		set.add(tmp.toLowerCase());
-	}
-	return set;
-    }
-
-    /**
-     * Just a wrapper to {@link #getSet(String, String)} for using '&#124;' as delimiter.
-     */
-    public static Set<String> getSet(final String stringlist) {
-	return getSet(stringlist, "|");
-    }
-
-    /**
-     * Checks if a string is null or empty.
-     * 
-     * @param str
-     *                to check
-     * @return <code>true</code> if the String is empty or null
-     */
-    public static boolean isEmpty(final String str) {
-	return str == null || str.length() == 0;
-    }
-
-    /**
-     * Just a wrapper to {@link #isEmpty(String)}.
-     * 
-     * @param str
-     * @return <code>true</code> if the String is not empty and not nul
-     */
-    public static boolean isNotEmpty(final String str) {
-	return !isEmpty(str);
-    }
-
-    /**
-     * Replaces all 'search' with 'replacement' in 'string'.
-     * 
-     * <pre>
-     * Utils.replaceAll(null, *, *)		= &quot;&quot;
-     * Utils.replaceAll(&quot;&quot;, *, *)		= &quot;&quot;
-     * Utils.replaceAll(&quot;foo&quot;, null, *)	= &quot;foo&quot;
-     * Utils.replaceAll(&quot;foo&quot;, &quot;o&quot;, &quot;a&quot;)	= &quot;faa&quot;
-     * </pre>
-     * 
-     * @param string
-     * @param search
-     * @param replacement
-     * @return replaced String
-     */
-    public static String replaceAll(final String string, final String search, final String replacement) {
-	if (isEmpty(string))
-	    return "";
-	if (isEmpty(search))
-	    return string;
-	if (string.indexOf(search) == -1)
-	    return string;
-	StringBuffer strb = new StringBuffer(string);
-	int pos = strb.indexOf(search);
-
-	while (pos != -1) {
-	    strb.replace(pos, pos + search.length(), replacement);
-	    pos = strb.indexOf(search);
-	}
-	return strb.toString();
-    }
-
-	public static String forceSingleExtension (final String filename) {
-
-		return filename.replaceAll("\\.(?![^.]+$)", "_"); 
-		
+		Set<String> set = new HashSet<String>();
+		StringTokenizer st = new StringTokenizer(stringList, delimiter);
+		while (st.hasMoreTokens()) {
+			String tmp = st.nextToken();
+			if (isNotEmpty(tmp)) // simple empty filter
+				set.add(tmp.toLowerCase());
+		}
+		return set;
 	}
 
-	public static boolean isSingleExtension (final String filename) {
-		
+	/**
+	 * Just a wrapper to {@link #getSet(String, String)} for using '&#124;' as delimiter.
+	 */
+	public static Set<String> getSet(final String stringlist) {
+		return getSet(stringlist, "|");
+	}
+
+	/**
+	 * Checks if a string is null or empty.
+	 * 
+	 * @param str
+	 *          to check
+	 * @return <code>true</code> if the String is empty or null
+	 */
+	public static boolean isEmpty(final String str) {
+		return str == null || str.length() == 0;
+	}
+
+	/**
+	 * Just a wrapper to {@link #isEmpty(String)}.
+	 * 
+	 * @param str
+	 * @return <code>true</code> if the String is not empty and not nul
+	 */
+	public static boolean isNotEmpty(final String str) {
+		return !isEmpty(str);
+	}
+
+	/**
+	 * Replaces all 'search' with 'replacement' in 'string'.
+	 * 
+	 * <pre>
+	 * Utils.replaceAll(null, *, *)		= &quot;&quot;
+	 * Utils.replaceAll(&quot;&quot;, *, *)		= &quot;&quot;
+	 * Utils.replaceAll(&quot;foo&quot;, null, *)	= &quot;foo&quot;
+	 * Utils.replaceAll(&quot;foo&quot;, &quot;o&quot;, &quot;a&quot;)	= &quot;faa&quot;
+	 * </pre>
+	 * 
+	 * @param string
+	 * @param search
+	 * @param replacement
+	 * @return replaced String
+	 */
+	public static String replaceAll(final String string, final String search, final String replacement) {
+		if (isEmpty(string))
+			return "";
+		if (isEmpty(search))
+			return string;
+		if (string.indexOf(search) == -1)
+			return string;
+		StringBuilder strb = new StringBuilder(string);
+		int pos = strb.indexOf(search);
+
+		while (pos != -1) {
+			strb.replace(pos, pos + search.length(), replacement);
+			pos = strb.indexOf(search);
+		}
+		return strb.toString();
+	}
+
+	/**
+	 * TODO - document me!
+	 * 
+	 * @param filename
+	 * @return
+	 */
+	public static String forceSingleExtension(final String filename) {
+		return filename.replaceAll("\\.(?![^.]+$)", "_");
+	}
+
+	/**
+	 * TODO - document me!
+	 * 
+	 * @param filename
+	 * @return
+	 */
+	public static boolean isSingleExtension(final String filename) {
 		return filename.matches("[^\\.]+\\.[^\\.]+");
-		
 	}
-	
-	public static boolean isValidPath (final String path) {
-		
+
+	/**
+	 * TODO - document me!
+	 * 
+	 * @param filename
+	 * @return
+	 */
+	public static boolean isValidPath(final String path) {
 		if (isEmpty(path))
 			return false;
-		
 		if (!path.startsWith("/"))
 			return false;
-		
 		if (!path.endsWith("/"))
 			return false;
-		
+
 		if (isEmpty(FilenameUtils.normalize(path)))
 			return false;
-		
 		if (path.contains("/..") || path.contains("../"))
 			return false;
 		if (path.contains("./") || path.contains("/."))
 			return false;
-		
+
 		return true;
 	}
