Index: /FCKeditor.Java/branches/2.4/src/main/java/net/fckeditor/connector/ConnectorServlet.java
===================================================================
--- /FCKeditor.Java/branches/2.4/src/main/java/net/fckeditor/connector/ConnectorServlet.java	(revision 1643)
+++ /FCKeditor.Java/branches/2.4/src/main/java/net/fckeditor/connector/ConnectorServlet.java	(revision 1644)
@@ -37,4 +37,5 @@
 import net.fckeditor.response.UploadResponse;
 import net.fckeditor.response.XmlResponse;
+import net.fckeditor.tool.UtilsFile;
 import net.fckeditor.tool.Utils;
 
@@ -130,5 +131,5 @@
 			xr.setFiles(currentDir);
 		} else if (commandStr.equals("CreateFolder")) {
-			String newFolderStr = Utils.sanitizeFolderName(request.getParameter("NewFolderName"));
+			String newFolderStr = UtilsFile.sanitizeFolderName(request.getParameter("NewFolderName"));
 			File newFolder = new File(currentDir, newFolderStr);
 			int errorNumber = XmlResponse.EN_UKNOWN;
@@ -198,5 +199,5 @@
 		UploadResponse ur = null;
 
-		if (!Utils.isValidPath(currentFolderStr)) {
+		if (!UtilsFile.isValidPath(currentFolderStr)) {
 			ur = new UploadResponse(UploadResponse.EN_SECURITY_ERROR, null, null,
 			        "'currentFolderStr' isn't valid!");
@@ -214,5 +215,5 @@
 			File currentDirPath = new File(getServletContext().getRealPath(currentPath));
 
-			if (!Utils.isValidPath(currentFolderStr) || !currentDirPath.exists())
+			if (!UtilsFile.isValidPath(currentFolderStr) || !currentDirPath.exists())
 				ur = UploadResponse.UR_BAD_REQUEST;
 			else {
@@ -226,5 +227,5 @@
 					// We upload only one file at the same time
 					FileItem uplFile = items.get(0);
-					String rawName = Utils.sanitizeFileName(uplFile.getName());
+					String rawName = UtilsFile.sanitizeFileName(uplFile.getName());
 					String filename = FilenameUtils.getName(rawName);
 					String baseName = FilenameUtils.removeExtension(filename);
@@ -258,5 +259,5 @@
 						// secure image check
 						if (fileType.equals(ResourceTypeHandler.IMAGE) && ConnectorHandler.isSecureImageUploads()) {
-							boolean check = Utils.isImage(uplFile.getInputStream());
+							boolean check = UtilsFile.isImage(uplFile.getInputStream());
 							if (check) {
 								uplFile.write(pathToSave);
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 1643)
+++ /FCKeditor.Java/branches/2.4/src/main/java/net/fckeditor/tool/Utils.java	(revision 1644)
@@ -21,5 +21,4 @@
 package net.fckeditor.tool;
 
-import java.io.InputStream;
 import java.util.HashSet;
 import java.util.Set;
@@ -30,6 +29,4 @@
 import net.fckeditor.handlers.ConnectorHandler;
 
-import org.apache.commons.io.FilenameUtils;
-import org.devlib.schmidt.imageinfo.ImageInfo;
 
 /**
@@ -134,47 +131,4 @@
 
 	/**
-	 * TODO - document me!
-	 * 
-	 * @param filename
-	 * @return string with a single dot only
-	 */
-	public static String forceSingleExtension(final String filename) {
-		return filename.replaceAll("\\.(?![^.]+$)", "_");
-	}
-
-	/**
-	 * TODO - document me!
-	 * 
-	 * @param filename
-	 * @return <code>true</code> if filename contains severals dots else
-	 *         <code>false</code>
-	 */
-	public static boolean isSingleExtension(final String filename) {
-		return filename.matches("[^\\.]+\\.[^\\.]+");
-	}
-
-	/**
-	 * TODO - document me!
-	 * 
-	 * @param path
-	 * @return <code>true</code> if path corresponds to rules else
-	 *         <code>false</code>
-	 */
-	public static boolean isValidPath(final String path) {
-		if (isEmpty(path))
-			return false;
-		if (!path.startsWith("/"))
-			return false;
-		if (!path.endsWith("/"))
-			return false;
-		
-		if (!path.equals(FilenameUtils.separatorsToUnix(FilenameUtils
-				.normalize(path))))
-			return false;
-		
-		return true;
-	}
-	
-	/**
 	 * TODO maybe change name?
 	 * TODO make it better
@@ -192,48 +146,4 @@
 		else
 			return request.getContextPath() + url;
-	}
-	
-	public static boolean isImage(final InputStream in) {
-		ImageInfo ii = new ImageInfo();
-		ii.setInput(in);
-		return ii.check();
-	}
-	
-
-	/**
-	 * Do a cleanup of the folder name to avoid possible problems.
-	 * 
-	 * @param folderName
-	 * @return folder name where . \ / | : ? * &quot; &lt; &gt; replaced by '_'
-	 */
-	public static String sanitizeFolderName(final String folderName) {
-		if (folderName == null)
-			return null;
-		if (folderName.equals(""))
-			return "";
-
-		// Remove . \ / | : ? * " < > with _
-		return folderName.replaceAll("\\.|\\/|\\/|\\||:|\\?|\\*|\"|<|>", "_");
-	}
-
-	
-	/**
-	 * Do a cleanup of the file name to avoid possible problems. <br>
-	 * The force single Extension property will be respected!
-	 * 
-	 * @param fileName
-	 * @return folder name where \ / | : ? * &quot; &lt; &gt; replaced by '_'
-	 */
-	public static String sanitizeFileName(final String fileName) {
-		if (fileName == null)
-			return null;
-		if (fileName.equals(""))
-			return "";
-
-		String name = (ConnectorHandler.isForceSingleExtension()) ? forceSingleExtension(fileName)
-		        : fileName;
-
-		// Remove \ / | : ? * " < > with _
-		return name.replaceAll("\\/|\\/|\\||:|\\?|\\*|\"|<|>", "_");
 	}	
 }
Index: /FCKeditor.Java/branches/2.4/src/main/java/net/fckeditor/tool/UtilsFile.java
===================================================================
--- /FCKeditor.Java/branches/2.4/src/main/java/net/fckeditor/tool/UtilsFile.java	(revision 1644)
+++ /FCKeditor.Java/branches/2.4/src/main/java/net/fckeditor/tool/UtilsFile.java	(revision 1644)
@@ -0,0 +1,128 @@
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2008 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ */
+package net.fckeditor.tool;
+
+import java.io.InputStream;
+
+import org.apache.commons.io.FilenameUtils;
+import org.devlib.schmidt.imageinfo.ImageInfo;
+
+import net.fckeditor.handlers.ConnectorHandler;
+
+/**
+ * Some static helper methods in conjunction with files.
+ *
+ * @version $Id$
+ */
+public class UtilsFile {
+
+	/**
+     * Do a cleanup of the file name to avoid possible problems. <br>
+     * The force single Extension property will be respected!
+     * 
+     * @param fileName
+     * @return folder name where \ / | : ? * &quot; &lt; &gt; replaced by '_'
+     */
+    public static String sanitizeFileName(final String fileName) {
+    	if (fileName == null)
+    		return null;
+    	if (fileName.equals(""))
+    		return "";
+    
+    	String name = (ConnectorHandler.isForceSingleExtension()) ? UtilsFile.forceSingleExtension(fileName)
+    	        : fileName;
+    
+    	// Remove \ / | : ? * " < > with _
+    	return name.replaceAll("\\/|\\/|\\||:|\\?|\\*|\"|<|>", "_");
+    }
+
+	/**
+     * Do a cleanup of the folder name to avoid possible problems.
+     * 
+     * @param folderName
+     * @return folder name where . \ / | : ? * &quot; &lt; &gt; replaced by '_'
+     */
+    public static String sanitizeFolderName(final String folderName) {
+    	if (folderName == null)
+    		return null;
+    	if (folderName.equals(""))
+    		return "";
+    
+    	// Remove . \ / | : ? * " < > with _
+    	return folderName.replaceAll("\\.|\\/|\\/|\\||:|\\?|\\*|\"|<|>", "_");
+    }
+
+	/**
+	 * Checks if the underlying file of the InputStrem is an image.
+	 * 
+	 * @param in
+	 * @return <code>True</code>, if the underlying file is an image, or <code>false</code>.
+	 */
+	public static boolean isImage(final InputStream in) {
+    	ImageInfo ii = new ImageInfo();
+    	ii.setInput(in);
+    	return ii.check();
+    }
+
+	/**
+     * TODO - document me!
+     * 
+     * @param path
+     * @return <code>true</code> if path corresponds to rules or
+     *         <code>false</code>.
+     */
+    public static boolean isValidPath(final String path) {
+    	if (Utils.isEmpty(path))
+    		return false;
+    	if (!path.startsWith("/"))
+    		return false;
+    	if (!path.endsWith("/"))
+    		return false;
+    	
+    	if (!path.equals(FilenameUtils.separatorsToUnix(FilenameUtils
+    			.normalize(path))))
+    		return false;
+    	
+    	return true;
+    }
+
+	/**
+     * TODO - document me!
+     * 
+     * @param filename
+     * @return string with a single dot only
+     */
+    public static String forceSingleExtension(final String filename) {
+    	return filename.replaceAll("\\.(?![^.]+$)", "_");
+    }
+
+	/**
+     * TODO - document me!
+     * 
+     * @param filename
+     * @return <code>true</code> if filename contains severals dots else
+     *         <code>false</code>
+     */
+    public static boolean isSingleExtension(final String filename) {
+    	return filename.matches("[^\\.]+\\.[^\\.]+");
+    }
+
+}
Index: /FCKeditor.Java/branches/2.4/src/test/java/net/fckeditor/tool/UtilsFileTest.java
===================================================================
--- /FCKeditor.Java/branches/2.4/src/test/java/net/fckeditor/tool/UtilsFileTest.java	(revision 1644)
+++ /FCKeditor.Java/branches/2.4/src/test/java/net/fckeditor/tool/UtilsFileTest.java	(revision 1644)
@@ -0,0 +1,176 @@
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2008 Frederico Caldeira Knabben
+ * 
+ * == BEGIN LICENSE ==
+ * 
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ * 
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ * 
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ * 
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ * 
+ * == END LICENSE ==
+ */
+package net.fckeditor.tool;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
+
+/**
+ * Tests for {@link UtilsFile}.
+ *
+ * @version $Id$
+ */
+public class UtilsFileTest {
+
+	@Test
+    public void isSingleExtension01() {
+    	boolean condition = UtilsFile.isSingleExtension("hacked.txt");
+    	assertTrue(condition);
+    }
+
+	@Test
+    public void isSingleExtension02() {
+    	boolean condition = UtilsFile.isSingleExtension("hacked.php_txt");
+    	assertTrue(condition);
+    }
+
+	@Test
+    public void isSingleExtension03() {
+    	boolean condition = UtilsFile.isSingleExtension("hacked.php.txt");
+    	assertFalse(condition);
+    }
+
+	@Test
+    public void isSingleExtension04() {
+    	boolean condition = UtilsFile.isSingleExtension("hacked.txt.");
+    	assertFalse(condition);
+    }
+
+	@Test
+    public void isSingleExtension05() {
+    	boolean condition = UtilsFile.isSingleExtension("hacked..txt");
+    	assertFalse(condition);
+    }
+
+	@Test
+    public void forceSingleExtension01() {
+    	String actual = UtilsFile.forceSingleExtension("hacked.txt");
+    	assertEquals("hacked.txt", actual);
+    }
+
+	@Test
+    public void forceSingleExtension02() {
+    	String actual = UtilsFile.forceSingleExtension("hacked.php_txt");
+    	assertEquals("hacked.php_txt", actual);
+    }
+
+	@Test
+    public void forceSingleExtension03() {
+    	String actual = UtilsFile.forceSingleExtension("hacked.php.txt");
+    	assertEquals("hacked_php.txt", actual);
+    }
+
+	@Test
+    public void forceSingleExtension04() {
+    	String actual = UtilsFile.forceSingleExtension("hacked..txt");
+    	assertEquals("hacked_.txt", actual);
+    }
+
+	@Test
+    public void isValidPath01() {
+    	String path = "";
+    	boolean condition = UtilsFile.isValidPath(path);
+    	assertFalse(condition);
+    }
+
+	@Test
+    public void isValidPath02() {
+    	String path = "/";
+    	boolean condition = UtilsFile.isValidPath(path);
+    	assertTrue(condition);
+    }
+
+	@Test
+    public void isValidPath03() {
+    	String path = "/./";
+    	boolean condition = UtilsFile.isValidPath(path);
+    	assertFalse(condition);
+    }
+
+	@Test
+    public void isValidPath04() {
+    	String path = "/newf/..";
+    	boolean condition = UtilsFile.isValidPath(path);
+    	assertFalse(condition);
+    }
+
+	@Test
+    public void isValidPath05() {
+    	String path = "/../";
+    	boolean condition = UtilsFile.isValidPath(path);
+    	assertFalse(condition);
+    }
+
+	@Test
+    public void isValidPath06() {
+    	String path = "/stuff/../..";
+    	boolean condition = UtilsFile.isValidPath(path);
+    	assertFalse(condition);
+    }
+
+	@Test
+    public void isValidPath07() {
+    	String path = "/my/stuff/../";
+    	boolean condition = UtilsFile.isValidPath(path);
+    	assertFalse(condition);
+    }
+
+	@Test
+    public void isValidPath08() {
+    	String path = "/my/stuff/";
+    	boolean condition = UtilsFile.isValidPath(path);
+    	assertTrue(condition);
+    }
+
+	@Test
+    public void isValidPath09() {
+    	String path = "/my/stuff";
+    	boolean condition = UtilsFile.isValidPath(path);
+    	assertFalse(condition);
+    }
+
+	@Test
+    public void isValidPath10() {
+    	String path = "my/stuff/";
+    	boolean condition = UtilsFile.isValidPath(path);
+    	assertFalse(condition);
+    }
+
+	@Test
+    public void sanitizeFolder01() {
+    	assertEquals("a_b_c_d_e_f_g_h_i_", UtilsFile.sanitizeFolderName("a.b|c<d>e:f?g*h<i>"));
+    }
+
+	@Test
+    public void sanitizeFile01() {
+    	assertEquals("b_c_d_e_f_g_h_i_", UtilsFile.sanitizeFileName("b|c<d>e:f?g*h<i>"));
+    }
+
+	@Test
+    public void sanitizeFile02() {
+    	assertEquals("name_ext1.ext2", UtilsFile.sanitizeFileName("name.ext1.ext2"));
+    }
+
+}
Index: /FCKeditor.Java/branches/2.4/src/test/java/net/fckeditor/tool/UtilsTest.java
===================================================================
--- /FCKeditor.Java/branches/2.4/src/test/java/net/fckeditor/tool/UtilsTest.java	(revision 1643)
+++ /FCKeditor.Java/branches/2.4/src/test/java/net/fckeditor/tool/UtilsTest.java	(revision 1644)
@@ -22,5 +22,4 @@
 
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
@@ -100,142 +99,3 @@
 		assertEquals(str, "faa");
 	}
-
-	@Test
-	public void isSingleExtension01() {
-		boolean condition = Utils.isSingleExtension("hacked.txt");
-		assertTrue(condition);
-	}
-
-	@Test
-	public void isSingleExtension02() {
-		boolean condition = Utils.isSingleExtension("hacked.php_txt");
-		assertTrue(condition);
-	}
-
-	@Test
-	public void isSingleExtension03() {
-		boolean condition = Utils.isSingleExtension("hacked.php.txt");
-		assertFalse(condition);
-	}
-
-	@Test
-	public void isSingleExtension04() {
-		boolean condition = Utils.isSingleExtension("hacked.txt.");
-		assertFalse(condition);
-	}
-
-	@Test
-	public void isSingleExtension05() {
-		boolean condition = Utils.isSingleExtension("hacked..txt");
-		assertFalse(condition);
-	}
-
-	@Test
-	public void forceSingleExtension01() {
-		String actual = Utils.forceSingleExtension("hacked.txt");
-		assertEquals("hacked.txt", actual);
-	}
-
-	@Test
-	public void forceSingleExtension02() {
-		String actual = Utils.forceSingleExtension("hacked.php_txt");
-		assertEquals("hacked.php_txt", actual);
-	}
-
-	@Test
-	public void forceSingleExtension03() {
-		String actual = Utils.forceSingleExtension("hacked.php.txt");
-		assertEquals("hacked_php.txt", actual);
-	}
-
-	@Test
-	public void forceSingleExtension04() {
-		String actual = Utils.forceSingleExtension("hacked..txt");
-		assertEquals("hacked_.txt", actual);
-	}
-
-	@Test
-	public void isValidPath01() {
-		String path = "";
-		boolean condition = Utils.isValidPath(path);
-		assertFalse(condition);
-	}
-
-	@Test
-	public void isValidPath02() {
-		String path = "/";
-		boolean condition = Utils.isValidPath(path);
-		assertTrue(condition);
-	}
-
-	@Test
-	public void isValidPath03() {
-		String path = "/./";
-		boolean condition = Utils.isValidPath(path);
-		assertFalse(condition);
-	}
-
-	@Test
-	public void isValidPath04() {
-		String path = "/newf/..";
-		boolean condition = Utils.isValidPath(path);
-		assertFalse(condition);
-	}
-
-	@Test
-	public void isValidPath05() {
-		String path = "/../";
-		boolean condition = Utils.isValidPath(path);
-		assertFalse(condition);
-	}
-
-	@Test
-	public void isValidPath06() {
-		String path = "/stuff/../..";
-		boolean condition = Utils.isValidPath(path);
-		assertFalse(condition);
-	}
-
-	@Test
-	public void isValidPath07() {
-		String path = "/my/stuff/../";
-		boolean condition = Utils.isValidPath(path);
-		assertFalse(condition);
-	}
-
-	@Test
-	public void isValidPath08() {
-		String path = "/my/stuff/";
-		boolean condition = Utils.isValidPath(path);
-		assertTrue(condition);
-	}
-	
-	@Test
-	public void isValidPath09() {
-		String path = "/my/stuff";
-		boolean condition = Utils.isValidPath(path);
-		assertFalse(condition);
-	}
-	
-	@Test
-	public void isValidPath10() {
-		String path = "my/stuff/";
-		boolean condition = Utils.isValidPath(path);
-		assertFalse(condition);
-	}
-
-	@Test
-	public void sanitizeFolder01() {
-		assertEquals("a_b_c_d_e_f_g_h_i_", Utils.sanitizeFolderName("a.b|c<d>e:f?g*h<i>"));
-	}
-	
-	@Test
-	public void sanitizeFile01() {
-		assertEquals("b_c_d_e_f_g_h_i_", Utils.sanitizeFileName("b|c<d>e:f?g*h<i>"));
-	}
-
-	@Test
-	public void sanitizeFile02() {
-		assertEquals("name_ext1.ext2", Utils.sanitizeFileName("name.ext1.ext2"));
-	}
 }
