Index: FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/connector/Connector.java
===================================================================
--- FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/connector/Connector.java	(revision 2407)
+++ FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/connector/Connector.java	(revision 2407)
@@ -0,0 +1,44 @@
+/*
+ * 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.connector;
+
+
+import javax.servlet.ServletContext;
+
+import net.fckeditor.handlers.ResourceType;
+import net.fckeditor.response.GetResponse;
+import net.fckeditor.response.UploadResponse;
+
+/**
+ * TODO Connector.java - document me 
+ *
+ * Hint: ResourceType and 'currentFolder' are checked by the caller
+ * ({@link Dispatcher}.
+ * 
+ * @version $Id$
+ */
+public interface Connector {
+	public void init(final ServletContext servletContext);
+	public GetResponse getFolders(final ResourceType type, final String currentFolder);
+	public GetResponse getFilesAndFolders(final ResourceType type, final String currentFolder);
+	public GetResponse createFolder(final ResourceType type, final String currentFolder, final String newFolder);
+	public UploadResponse fileUpload(final ResourceType type, final String currentFolder, final String fileName, byte[] data);
+}
Index: FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/connector/ConnectorServlet.java
===================================================================
--- FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/connector/ConnectorServlet.java	(revision 2406)
+++ FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/connector/ConnectorServlet.java	(revision 2407)
@@ -21,8 +21,5 @@
 package net.fckeditor.connector;
 
-import java.io.File;
 import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.List;
 
 import javax.servlet.ServletException;
@@ -31,297 +28,72 @@
 import javax.servlet.http.HttpServletResponse;
 
-import net.fckeditor.handlers.CommandHandler;
-import net.fckeditor.handlers.ConnectorHandler;
-import net.fckeditor.handlers.ExtensionsHandler;
-import net.fckeditor.handlers.LocalizedPropertiesLoader;
 import net.fckeditor.handlers.RequestCycleHandler;
-import net.fckeditor.handlers.ResourceTypeHandler;
-import net.fckeditor.response.UploadResponse;
-import net.fckeditor.response.XmlResponse;
-import net.fckeditor.tool.Utils;
-import net.fckeditor.tool.UtilsFile;
-import net.fckeditor.tool.UtilsResponse;
-
-import org.apache.commons.fileupload.FileItem;
-import org.apache.commons.fileupload.FileItemFactory;
-import org.apache.commons.fileupload.disk.DiskFileItemFactory;
-import org.apache.commons.fileupload.servlet.ServletFileUpload;
-import org.apache.commons.io.FilenameUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import net.fckeditor.requestcycle.ThreadLocalData;
 
 /**
- * Servlet to upload and browse files.<br />
- * 
- * This servlet accepts 4 commands which interact with the server-side
- * filesystem.<br />
- * The allowed commands are:
+ * This is the FCKeditor servlet. It has the following jobs:
  * <ul>
- * <li><code>GetFolders</code>: Retrieves a list of folders in the current
- * folder</li>
- * <li><code>GetFoldersAndFiles</code>: Retrieves a list of files and
- * folders in the current folder</li>
- * <li><code>CreateFolder</code>: Creates a new folder in the current folder</li>
- * <li><code>FileUpload</code>: Stores an uploaded file into the current
- * folder. (must be sent with POST)</li>
- * </ul>
+ * <li>Initialization of the {@link Dispatcher}-object. It refers the request to
+ * the {@link Connector}s implementation.</li>
+ * <li>Calling {@link ThreadLocalData#beginRequest(HttpServletRequest)}
+ * (It is an object that holds request-based objects.)</li>
+ * <li>Dispatching the doGet-request to
+ * {@link Dispatcher#doGet(HttpServletRequest, HttpServletResponse)} and the
+ * doPost-request to
+ * {@link Dispatcher#doPost(HttpServletRequest, HttpServletResponse)}.</li>
+ * <li>Calling {@link ThreadLocalData#endRequest()} to cleanup all ThreadLocal
+ * objects independent of if an exception was thrown or not. That's very
+ * important to prevent memory-leaks!!!</li>
+ * </ul><br>
+ * Summing up: This is servlet to insure the correct initialization and cleaning
+ * of the {@link ThreadLocalData}. All requests are dispatched to the
+ * {@link Dispatcher}. The {@link Dispatcher} forwards the request to an
+ * implementation of {@link Connector}.<br>
+ * TODO take a closer look to the exception handling !!!
  * 
  * @version $Id$
  */
 public class ConnectorServlet extends HttpServlet {
-
 	private static final long serialVersionUID = -5742008970929377161L;
-	private static final Logger logger = LoggerFactory
-			.getLogger(ConnectorServlet.class);
-
-	/**
-	 * Initialize the servlet: <code>mkdir</code> &lt;DefaultUserFilesPath&gt;
+	private Dispatcher dispatcher;
+	
+	/* (non-Javadoc)
+	 * @see javax.servlet.GenericServlet#init()
 	 */
-	public void init() throws ServletException, IllegalArgumentException {
-		String realDefaultUserFilesPath = getServletContext().getRealPath(
-				ConnectorHandler.getDefaultUserFilesPath());
-
-		File defaultUserFilesDir = new File(realDefaultUserFilesPath);
-		UtilsFile.checkDirAndCreate(defaultUserFilesDir);
-
-		logger.info("ConnectorServlet successfully initialized!");
+	@Override
+	public void init() throws ServletException {
+		dispatcher = new Dispatcher(getServletContext(), RequestCycleHandler.getConnector());
+	}
+	
+	/* (non-Javadoc)
+	 * @see javax.servlet.http.HttpServlet#doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
+	 */
+	@Override
+	protected void doGet(final HttpServletRequest request, final HttpServletResponse response)
+			throws ServletException, IOException {
+		try {
+			ThreadLocalData.beginRequest(request);
+			dispatcher.doGet(request, response);
+		} catch (Exception e) {
+			// TODO: handle exception
+		} finally {
+			ThreadLocalData.endRequest();
+		}		
 	}
 
-	/**
-	 * Manage the <code>GET</code> requests (<code>GetFolders</code>,
-	 * <code>GetFoldersAndFiles</code>, <code>CreateFolder</code>).<br/>
-	 * 
-	 * The servlet accepts commands sent in the following format:<br/>
-	 * <code>connector?Command=&lt;CommandName&gt;&Type=&lt;ResourceType&gt;&CurrentFolder=&lt;FolderPath&gt;</code>
-	 * <p>
-	 * It executes the commands and then returns the result to the client in XML
-	 * format.
-	 * </p>
+	/* (non-Javadoc)
+	 * @see javax.servlet.http.HttpServlet#doPost(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
 	 */
-	public void doGet(HttpServletRequest request, HttpServletResponse response)
+	@Override
+	protected void doPost(final HttpServletRequest request, final HttpServletResponse response)
 			throws ServletException, IOException {
-		logger.debug("Entering ConnectorServlet#doGet");
-
-		response.setCharacterEncoding("UTF-8");
-		response.setContentType("application/xml; charset=UTF-8");
-		response.setHeader("Cache-Control", "no-cache");
-		PrintWriter out = response.getWriter();
-
-		String commandStr = request.getParameter("Command");
-		String typeStr = request.getParameter("Type");
-		String currentFolderStr = request.getParameter("CurrentFolder");
-
-		logger.debug("Parameter Command: {}", commandStr);
-		logger.debug("Parameter Type: {}", typeStr);
-		logger.debug("Parameter CurrentFolder: {}", currentFolderStr);
-
-		XmlResponse xr;
-		LocalizedPropertiesLoader lpl = LocalizedPropertiesLoader.getInstance(request);
-
-		// FIXME check for isEnabledForFolderCreation
-		if (!RequestCycleHandler.isEnabledForFileBrowsing(request))
-			xr = new XmlResponse(XmlResponse.EN_ERROR, lpl
-					.getFileBrowsingDisabled());
-		else if (!CommandHandler.isValidForGet(commandStr))
-			xr = new XmlResponse(XmlResponse.EN_ERROR, lpl.getInvalidCommand());
-		else if (typeStr != null && !ResourceTypeHandler.isValid(typeStr))
-			xr = new XmlResponse(XmlResponse.EN_ERROR, lpl.getInvalidType());
-		else if (!UtilsFile.isValidPath(currentFolderStr))
-			xr = new XmlResponse(XmlResponse.EN_ERROR, lpl
-					.getInvalidCurrentFolder());
-		else {
-			CommandHandler command = CommandHandler.getCommand(commandStr);
-			ResourceTypeHandler resourceType = ResourceTypeHandler
-					.getDefaultResourceType(typeStr);
-
-			String typePath = UtilsFile.constructServerSidePath(request,
-					resourceType);
-			String typeDirPath = getServletContext().getRealPath(typePath);
-
-			File typeDir = new File(typeDirPath);
-			UtilsFile.checkDirAndCreate(typeDir);
-
-			File currentDir = new File(typeDir, currentFolderStr);
-
-			if (!currentDir.exists())
-				xr = new XmlResponse(XmlResponse.EN_INVALID_FOLDER_NAME);
-			else {
-
-				xr = new XmlResponse(command, resourceType, currentFolderStr,
-						UtilsResponse.constructResponseUrl(request,
-								resourceType, currentFolderStr, ConnectorHandler.isFullUrl()));
-
-				if (command.equals(CommandHandler.GET_FOLDERS))
-					xr.setFolders(currentDir);
-				else if (command.equals(CommandHandler.GET_FOLDERS_AND_FILES))
-					xr.setFoldersAndFiles(currentDir);
-				else if (command.equals(CommandHandler.CREATE_FOLDER)) {
-					String newFolderStr = UtilsFile.sanitizeFolderName(request
-							.getParameter("NewFolderName"));
-					logger.debug("Parameter NewFolderName: {}", newFolderStr);
-
-					File newFolder = new File(currentDir, newFolderStr);
-					int errorNumber = XmlResponse.EN_UKNOWN;
-
-					if (newFolder.exists())
-						errorNumber = XmlResponse.EN_ALREADY_EXISTS;
-					else {
-						try {
-							errorNumber = (newFolder.mkdir()) ? XmlResponse.EN_OK
-									: XmlResponse.EN_INVALID_FOLDER_NAME;
-						} catch (SecurityException e) {
-							errorNumber = XmlResponse.EN_SECURITY_ERROR;
-						}
-					}
-					xr.setError(errorNumber);
-				}
-			}
+		try {
+			ThreadLocalData.beginRequest(request);
+			dispatcher.doPost(request, response);
+		} catch (Exception e) {
+			// TODO: handle exception
+		} finally {
+			ThreadLocalData.endRequest();
 		}
-
-		out.print(xr);
-		out.flush();
-		out.close();
-		logger.debug("Exiting ConnectorServlet#doGet");
-	}
-
-	/**
-	 * Manage the <code>POST</code> requests (<code>FileUpload</code>).<br />
-	 * 
-	 * The servlet accepts commands sent in the following format:<br />
-	 * <code>connector?Command=&lt;FileUpload&gt;&Type=&lt;ResourceType&gt;&CurrentFolder=&lt;FolderPath&gt;</code>
-	 * with the file in the <code>POST</code> body.<br />
-	 * <br>
-	 * It stores an uploaded file (renames a file if another exists with the
-	 * same name) and then returns the JavaScript callback.
-	 */
-	@SuppressWarnings("unchecked")
-	public void doPost(HttpServletRequest request, HttpServletResponse response)
-			throws ServletException, IOException {
-		logger.debug("Entering Connector#doPost");
-
-		response.setCharacterEncoding("UTF-8");
-		response.setContentType("text/html; charset=UTF-8");
-		response.setHeader("Cache-Control", "no-cache");
-		PrintWriter out = response.getWriter();
-
-		String commandStr = request.getParameter("Command");
-		String typeStr = request.getParameter("Type");
-		String currentFolderStr = request.getParameter("CurrentFolder");
-
-		logger.debug("Parameter Command: {}", commandStr);
-		logger.debug("Parameter Type: {}", typeStr);
-		logger.debug("Parameter CurrentFolder: {}", currentFolderStr);
-
-		UploadResponse ur;
-		LocalizedPropertiesLoader lpl = LocalizedPropertiesLoader.getInstance(request);
-
-		// if this is a QuickUpload request, 'commandStr' and 'currentFolderStr'
-		// are empty
-		if (Utils.isEmpty(commandStr) && Utils.isEmpty(currentFolderStr)) {
-			commandStr = "QuickUpload";
-			currentFolderStr = "/";
-		}
-
-		if (!RequestCycleHandler.isEnabledForFileUpload(request))
-			ur = new UploadResponse(UploadResponse.SC_SECURITY_ERROR, null,
-					null, lpl.getFileBrowsingDisabled());
-		else if (!CommandHandler.isValidForPost(commandStr))
-			ur = new UploadResponse(UploadResponse.SC_ERROR, null, null, lpl
-					.getInvalidCommand());
-		else if (typeStr != null && !ResourceTypeHandler.isValid(typeStr))
-			ur = new UploadResponse(UploadResponse.SC_ERROR, null, null, lpl
-					.getInvalidType());
-		else if (!UtilsFile.isValidPath(currentFolderStr))
-			ur = new UploadResponse(UploadResponse.SC_ERROR, null, null, lpl
-					.getInvalidCurrentFolder());
-		else {
-			ResourceTypeHandler resourceType = ResourceTypeHandler
-					.getDefaultResourceType(typeStr);
-
-			String typePath = UtilsFile.constructServerSidePath(request,
-					resourceType);
-			String typeDirPath = getServletContext().getRealPath(typePath);
-
-			File typeDir = new File(typeDirPath);
-			UtilsFile.checkDirAndCreate(typeDir);
-
-			File currentDir = new File(typeDir, currentFolderStr);
-
-			if (!currentDir.exists())
-				ur = new UploadResponse(UploadResponse.SC_ERROR, null, null,
-						lpl.getInvalidCurrentFolder());
-			else {
-
-				String newFilename = null;
-				FileItemFactory factory = new DiskFileItemFactory();
-				ServletFileUpload upload = new ServletFileUpload(factory);
-
-				try {
-
-					List<FileItem> items = upload.parseRequest(request);
-
-					// We upload only one file at the same time
-					FileItem uplFile = items.get(0);
-					String rawName = UtilsFile.sanitizeFileName(uplFile
-							.getName());
-					String filename = FilenameUtils.getName(rawName);
-					String baseName = FilenameUtils.removeExtension(filename);
-					String extension = FilenameUtils.getExtension(filename);
-
-					if (!ExtensionsHandler.isAllowed(resourceType, extension))
-						ur = new UploadResponse(
-								UploadResponse.SC_INVALID_EXTENSION);
-					else {
-
-						// construct an unique file name
-						File pathToSave = new File(currentDir, filename);
-						int counter = 1;
-						while (pathToSave.exists()) {
-							newFilename = baseName.concat("(").concat(
-									String.valueOf(counter)).concat(")")
-									.concat(".").concat(extension);
-							pathToSave = new File(currentDir, newFilename);
-							counter++;
-						}
-
-						if (Utils.isEmpty(newFilename))
-							ur = new UploadResponse(UploadResponse.SC_OK,
-									UtilsResponse.constructResponseUrl(request,
-											resourceType, currentFolderStr,
-											ConnectorHandler.isFullUrl())
-											.concat(filename));
-						else
-							ur = new UploadResponse(UploadResponse.SC_RENAMED,
-									UtilsResponse.constructResponseUrl(request,
-											resourceType, currentFolderStr,
-											ConnectorHandler.isFullUrl())
-											.concat(newFilename), newFilename);
-
-						// secure image check
-						if (resourceType.equals(ResourceTypeHandler.IMAGE)
-								&& ConnectorHandler.isSecureImageUploads()) {
-							if (UtilsFile.isImage(uplFile.getInputStream()))
-								uplFile.write(pathToSave);
-							else {
-								uplFile.delete();
-								ur = new UploadResponse(
-										UploadResponse.SC_INVALID_EXTENSION);
-							}
-						} else
-							uplFile.write(pathToSave);
-
-					}
-				} catch (Exception e) {
-					ur = new UploadResponse(UploadResponse.SC_SECURITY_ERROR);
-				}
-			}
-
-		}
-
-		out.print(ur);
-		out.flush();
-		out.close();
-
-		logger.debug("Exiting Connector#doPost");
 	}
 
Index: FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/connector/Dispatcher.java
===================================================================
--- FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/connector/Dispatcher.java	(revision 2407)
+++ FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/connector/Dispatcher.java	(revision 2407)
@@ -0,0 +1,197 @@
+/*
+ * 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.connector;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.List;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import net.fckeditor.handlers.CommandHandler;
+import net.fckeditor.handlers.ConnectorHandler;
+import net.fckeditor.handlers.ResourceType;
+import net.fckeditor.response.GetResponse;
+import net.fckeditor.response.UploadResponse;
+import net.fckeditor.tool.Utils;
+import net.fckeditor.tool.UtilsFile;
+
+import org.apache.commons.fileupload.FileItem;
+import org.apache.commons.fileupload.FileItemFactory;
+import org.apache.commons.fileupload.disk.DiskFileItemFactory;
+import org.apache.commons.fileupload.servlet.ServletFileUpload;
+import org.apache.commons.io.FilenameUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * Encapsulates the verification of the parameters and {@link Connector}-calls. So the complete 
+ * XML-handling could be changed without afford to the {@link Connector}s.
+ * 
+ * @version $Id$
+ */
+public class Dispatcher {
+	private static final Logger logger = LoggerFactory.getLogger(Dispatcher.class);
+	private Connector connector = null;
+	
+	protected Dispatcher(final ServletContext servletContext, final Connector connector) {
+		this.connector = connector;
+		this.connector.init(servletContext);
+		logger.info("Initialized!");
+	}
+	
+	
+	/**
+	 * Manage the <code>GET</code> requests (<code>GetFolders</code>,
+	 * <code>GetFoldersAndFiles</code>, <code>CreateFolder</code>).<br/>
+	 * 
+	 * The method accepts commands sent in the following format:<br/>
+	 * <code>connector?Command=&lt;CommandName&gt;&Type=&lt;ResourceType&gt;&CurrentFolder=&lt;FolderPath&gt;</code>
+	 * <p>
+	 * It executes the relevant commands and then returns the result to the client in XML
+	 * format.
+	 * </p>
+	 */
+	public void doGet(final HttpServletRequest request, final HttpServletResponse response) throws IOException {
+		logger.debug("Entering Dispatcher#doGet");
+
+		response.setCharacterEncoding("UTF-8");
+		response.setContentType("application/xml; charset=UTF-8");
+		response.setHeader("Cache-Control", "no-cache");
+		PrintWriter out = response.getWriter();
+
+		String commandStr = request.getParameter("Command");
+		String typeStr = request.getParameter("Type");
+		String currentFolderStr = request.getParameter("CurrentFolder");
+
+		logger.debug("Parameter Command: {}", commandStr);
+		logger.debug("Parameter Type: {}", typeStr);
+		logger.debug("Parameter CurrentFolder: {}", currentFolderStr);
+		
+		GetResponse getResponse;
+		// check conditions/parameters
+		// FIXME check permissions for user actions !!!
+		if (!CommandHandler.isValidForGet(commandStr))
+			getResponse = GetResponse.getErrorInvalidCommand();
+		else if (!ResourceType.isValid(typeStr))
+			getResponse = GetResponse.getErrorInvalidType();
+		else if (!UtilsFile.isValidPath(currentFolderStr))
+			getResponse = GetResponse.getErrorInvalidCurrentFolder();
+		else {
+			
+			// call the right Connector method depending on the command
+			ResourceType type = ResourceType.getDefaultResourceType(typeStr);
+			CommandHandler command = CommandHandler.getCommand(commandStr);
+			if (command.equals(CommandHandler.GET_FOLDERS))
+				getResponse = connector.getFolders(type, currentFolderStr);
+			else if (command.equals(CommandHandler.GET_FOLDERS_AND_FILES))
+				getResponse = connector.getFilesAndFolders(type, currentFolderStr);
+			else if (command.equals(CommandHandler.CREATE_FOLDER)) {
+				String newFolderStr = UtilsFile.sanitizeFolderName(request.getParameter("NewFolderName"));
+				logger.debug("Parameter NewFolderName: {}", newFolderStr);
+				getResponse = connector.createFolder(type, currentFolderStr, newFolderStr);
+			} else 
+				getResponse = GetResponse.getErrorUnknown();
+		}
+		
+		out.print(getResponse);
+		out.flush();
+		out.close();
+		logger.debug("Exiting Dispatcher#doGet");
+	}
+
+	/**
+	 * Manage the <code>POST</code> requests (<code>FileUpload</code>).<br />
+	 * 
+	 * The method accepts commands sent in the following format:<br />
+	 * <code>connector?Command=&lt;FileUpload&gt;&Type=&lt;ResourceType&gt;&CurrentFolder=&lt;FolderPath&gt;</code>
+	 * with the file in the <code>POST</code> body.<br />
+	 * <br>
+	 * The Connector stores an uploaded file (renames a file if another exists with the
+	 * same name) and then returns the JavaScript callback.
+	 * @throws IOException 
+	 */
+	public void doPost(final HttpServletRequest request, final HttpServletResponse response) throws IOException {
+		logger.debug("Entering Dispatcher#doPost");
+		response.setCharacterEncoding("UTF-8");
+		response.setContentType("text/html; charset=UTF-8");
+		response.setHeader("Cache-Control", "no-cache");
+		PrintWriter out = response.getWriter();
+
+		String commandStr = request.getParameter("Command");
+		String typeStr = request.getParameter("Type");
+		String currentFolderStr = request.getParameter("CurrentFolder");
+
+		logger.debug("Parameter Command: {}", commandStr);
+		logger.debug("Parameter Type: {}", typeStr);
+		logger.debug("Parameter CurrentFolder: {}", currentFolderStr);
+		logger.debug("Exiting Dispatcher#doPost");
+
+		// if this is a QuickUpload request, 'commandStr' and 'currentFolderStr'
+		// are empty
+		if (Utils.isEmpty(commandStr) && Utils.isEmpty(currentFolderStr)) {
+			commandStr = "QuickUpload";
+			currentFolderStr = "/";
+		}
+		
+		UploadResponse uploadResponse;
+		// FIXME check permissions for user actions !!!
+		if (!CommandHandler.isValidForPost(commandStr))
+			uploadResponse = UploadResponse.getErrorInvalidCommand();
+		else if (!ResourceType.isValid(typeStr))
+			uploadResponse = UploadResponse.getErrorInvalidType();
+		else if (!UtilsFile.isValidPath(currentFolderStr))
+			uploadResponse = UploadResponse.getErrorInvalidCurrentFolder();
+		else {
+
+			// call the Connector#fileUpload
+			ResourceType type = ResourceType.getDefaultResourceType(typeStr);
+			FileItemFactory factory = new DiskFileItemFactory();
+			ServletFileUpload upload = new ServletFileUpload(factory);
+			try {
+				@SuppressWarnings("unchecked") List<FileItem> items = upload.parseRequest(request);
+				// We upload just one file at the same time
+				FileItem uplFile = items.get(0);
+				// Secure image check
+				if (type.equals(ResourceType.IMAGE) && ConnectorHandler.isSecureImageUploads()
+						&& !UtilsFile.isImage(uplFile.getInputStream())) {
+					uploadResponse = UploadResponse.getErrorInvalidExtension();
+				} else {
+					String fileName = FilenameUtils.getName(UtilsFile.sanitizeFileName(uplFile.getName()));
+					uploadResponse = connector.fileUpload(type, currentFolderStr, fileName, uplFile.get());
+					/* TODO check if there could be a memory overflow problem. Though about committing the while FileItem instead of byte[]!!*/
+				}
+				uplFile.delete();
+			} catch (Exception e) {
+				uploadResponse = UploadResponse.getErrorSecurity();
+			}
+		}
+		out.print(uploadResponse);
+		out.flush();
+		out.close();
+		logger.debug("Exiting Dispatcher#doPost");
+	}
+	
+	
+}
Index: FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/connector/impl/SimpleFileSystemConnector.java
===================================================================
--- FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/connector/impl/SimpleFileSystemConnector.java	(revision 2407)
+++ FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/connector/impl/SimpleFileSystemConnector.java	(revision 2407)
@@ -0,0 +1,197 @@
+/*
+ * 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.connector.impl;
+
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileFilter;
+import java.io.FileOutputStream;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.ServletContext;
+
+import net.fckeditor.connector.Connector;
+import net.fckeditor.handlers.CommandHandler;
+import net.fckeditor.handlers.ConnectorHandler;
+import net.fckeditor.handlers.ExtensionsHandler;
+import net.fckeditor.handlers.PropertiesLoader;
+import net.fckeditor.handlers.ResourceType;
+import net.fckeditor.response.GetResponse;
+import net.fckeditor.response.UploadResponse;
+import net.fckeditor.tool.UtilsFile;
+import net.fckeditor.tool.UtilsResponse;
+
+import org.apache.commons.io.FilenameUtils;
+import org.apache.commons.io.filefilter.DirectoryFileFilter;
+import org.apache.commons.io.filefilter.FileFileFilter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Implementation of the {@link Connector} for the filesystem. All path are interpreted as sub-directories 
+ * inside the root of the {@link ConnectorHandler#getUserFilesPath()}.<br>
+ * 
+ * TODO move the static methods into a util-class in package net.fckeditor.connector.impl ???
+ * @version $Id$
+ */
+public class SimpleFileSystemConnector implements Connector {
+	private static final Logger logger = LoggerFactory.getLogger(SimpleFileSystemConnector.class);
+	private static Map<ResourceType, String> paths = new HashMap<ResourceType, String>(4);
+	private static ServletContext servletContext;
+	
+	static {
+		// initialize the sub folders for each resource type
+		paths.put(ResourceType.FILE, PropertiesLoader.getProperty("connector.resourceType.file.path"));
+		paths.put(ResourceType.IMAGE, PropertiesLoader.getProperty("connector.resourceType.image.path"));
+		paths.put(ResourceType.FLASH, PropertiesLoader.getProperty("connector.resourceType.flash.path"));
+		paths.put(ResourceType.MEDIA, PropertiesLoader.getProperty("connector.resourceType.media.path"));
+	}
+
+	/* (non-Javadoc)
+	 * @see net.fckeditor.connector.Connector#init()
+	 */
+	public void init(final ServletContext servletContext) {
+		// create user's default dir
+		SimpleFileSystemConnector.servletContext = servletContext;
+		String realDefaultUserFilesPath = SimpleFileSystemConnector.servletContext.getRealPath(ConnectorHandler.getDefaultUserFilesPath());
+		File defaultUserFilesDir = new File(realDefaultUserFilesPath);
+		UtilsFile.checkDirAndCreate(defaultUserFilesDir);
+		logger.info("Initialized!");
+	}
+	
+	/* (non-Javadoc)
+	 * @see net.fckeditor.connector.Connector#fileUpload(net.fckeditor.handlers.ResourceType, java.lang.String, java.lang.String, byte[])
+	 */
+	public UploadResponse fileUpload(final ResourceType type, final String currentFolder, final String fileName, byte[] data) {
+		if (!ExtensionsHandler.isAllowed(type, FilenameUtils.getExtension(fileName)))
+			return UploadResponse.getErrorInvalidExtension();
+		String baseDir = ConnectorHandler.getDefaultUserFilesPath();
+		File typeDir = getAndCreateResourceTypeDir(baseDir, type);
+		File currentDir = new File(typeDir, currentFolder);
+		if (!currentDir.exists())
+			return UploadResponse.getErrorInvalidCurrentFolder();
+		File newFile = new File(currentDir, fileName);
+		File fileToSave = getUniqueFile(newFile.getAbsoluteFile());
+		try {
+			BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(fileToSave));
+			out.write(data);
+		} catch (Exception e) {
+			return UploadResponse.getErrorSecurity();
+		}
+		String responseUrl = UtilsResponse.constructResponseUrl(type, paths.get(typeDir), currentFolder)
+				.concat(fileToSave.getName());
+		UploadResponse uploadResponse;
+		if (!fileToSave.getAbsoluteFile().equals(newFile.getAbsoluteFile()))
+			uploadResponse = new UploadResponse(UploadResponse.SC_RENAMED, responseUrl, fileToSave.getName());
+		else
+			uploadResponse = new UploadResponse(UploadResponse.SC_OK, responseUrl);
+		return uploadResponse;
+	}
+	
+	/* (non-Javadoc)
+	 * @see net.fckeditor.connector.Connector#createFolder(net.fckeditor.handlers.ResourceType, java.lang.String, java.lang.String)
+	 */
+	public GetResponse createFolder(final ResourceType type, final String currentFolder, final String newFolder) {
+		String baseDir = ConnectorHandler.getDefaultUserFilesPath();
+		File typeDir = getAndCreateResourceTypeDir(baseDir, type);
+		File currentDir = new File(typeDir, currentFolder);
+		if (!currentDir.exists())
+			return GetResponse.getErrorInvalidCurrentFolder();
+		File newDir = new File(currentDir, newFolder);
+		if (newDir.exists())
+			return GetResponse.getErrorFolderAlreadyExists();
+		try {
+			return (newDir.mkdir()) ? GetResponse.getOK() : GetResponse.getErrorInvalidFolderName();
+		} catch (SecurityException e) {
+			return GetResponse.getErrorSecurity();
+		}
+	}
+
+	/* (non-Javadoc)
+	 * @see net.fckeditor.connector.Connector#getFolders(net.fckeditor.handlers.ResourceType, java.lang.String)
+	 */
+	public GetResponse getFolders(final ResourceType type, final String currentFolder) {
+		String baseDir = ConnectorHandler.getDefaultUserFilesPath();
+		File typeDir = getAndCreateResourceTypeDir(baseDir, type);
+		File currentDir = new File(typeDir, currentFolder);
+		if (!currentDir.exists())
+			return GetResponse.getErrorInvalidCurrentFolder();
+		
+		GetResponse getResponse = new GetResponse(CommandHandler.GET_FOLDERS_AND_FILES, type, 
+				currentFolder, UtilsResponse.constructResponseUrl(type, paths.get(type), currentFolder));
+		getResponse.setFolders(getFolders(currentDir));
+		return getResponse;
+	}
+
+	/* (non-Javadoc)
+	 * @see net.fckeditor.connector.Connector#getFiles(net.fckeditor.handlers.ResourceType, java.lang.String)
+	 */
+	public GetResponse getFilesAndFolders(final ResourceType type, final String currentFolder) {
+		String baseDir = ConnectorHandler.getDefaultUserFilesPath();
+		File typeDir = getAndCreateResourceTypeDir(baseDir, type);
+		File currentDir = new File(typeDir, currentFolder);
+		if (!currentDir.exists())
+			return GetResponse.getErrorInvalidCurrentFolder();
+		
+		GetResponse getResponse = new GetResponse(CommandHandler.GET_FOLDERS_AND_FILES, type, 
+				currentFolder, UtilsResponse.constructResponseUrl(type, paths.get(type), currentFolder));
+		getResponse.setFolders(getFolders(currentDir));
+		// collect files
+		File[] fileList = currentDir.listFiles((FileFilter) FileFileFilter.FILE);
+		Map<String, Long> files = new HashMap<String, Long>(fileList.length);
+		for (File file : fileList) {
+			files.put(file.getName(), new Long(file.length()));
+		}
+		getResponse.setFiles(files);
+		return getResponse;
+	}
+	
+	private static List<String> getFolders(final File currentDir) {
+		String[] fileList = currentDir.list(DirectoryFileFilter.DIRECTORY);
+		return Arrays.asList(fileList);
+	}
+	
+	private static File getAndCreateResourceTypeDir(final String baseDir, final ResourceType type) {
+		File dir = new File(servletContext.getRealPath(baseDir), paths.get(type));
+		if (!dir.exists())
+			dir.mkdirs();
+		return dir;
+	}
+	
+	private static File getUniqueFile(final File file) {
+		if (!file.exists())
+			return file;
+		
+		File tmpFile = new File(file.getAbsolutePath());
+		File dir = tmpFile.getParentFile();
+		int count = 1;
+		String extension = ".".concat(FilenameUtils.getExtension(tmpFile.getName()));
+		do {
+			String baseName = FilenameUtils.getBaseName(tmpFile.getName());
+			tmpFile = new File(dir, baseName.concat("(".concat(String.valueOf(count)).concat(")").concat(extension)));
+			count++;
+		} while (tmpFile.exists());
+		return tmpFile;
+	}
+}
Index: FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/handlers/ConnectorHandler.java
===================================================================
--- FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/handlers/ConnectorHandler.java	(revision 2406)
+++ FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/handlers/ConnectorHandler.java	(revision 2407)
@@ -21,6 +21,5 @@
 package net.fckeditor.handlers;
 
-import javax.servlet.http.HttpServletRequest;
-
+import net.fckeditor.connector.Connector;
 import net.fckeditor.requestcycle.UserPathBuilder;
 
@@ -34,12 +33,13 @@
 
 	/**
-	 * Getter for the <code>UserFilesPath</code>.
+	 * Getter for the <code>UserFilesPath</code>.<br>
+	 * Should be use in the implementations of {@link Connector}.
 	 * 
-	 * @return {@link UserPathBuilder#getUserFilesPath(HttpServletRequest)} or
+	 * @return {@link UserPathBuilder#getUserFilesPath()} or
 	 *         the <code>DefaultUserFilePath</code> if {@link UserPathBuilder}
 	 *         isn't set.
 	 */
-	public static String getUserFilesPath(final HttpServletRequest request) {
-    	String userFilePath = RequestCycleHandler.getUserFilePath(request);
+	public static String getUserFilesPath() {
+    	String userFilePath = RequestCycleHandler.getUserFilePath();
     	return (userFilePath != null) ? userFilePath : getDefaultUserFilesPath();
     }
Index: FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/handlers/ExtensionsHandler.java
===================================================================
--- FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/handlers/ExtensionsHandler.java	(revision 2406)
+++ FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/handlers/ExtensionsHandler.java	(revision 2407)
@@ -42,24 +42,24 @@
 public class ExtensionsHandler {
 
-	private static Map<ResourceTypeHandler, Set<String>> extensionsAllowed = new HashMap<ResourceTypeHandler, Set<String>>();
-	private static Map<ResourceTypeHandler, Set<String>> extensionsDenied = new HashMap<ResourceTypeHandler, Set<String>>();
+	private static Map<ResourceType, Set<String>> extensionsAllowed = new HashMap<ResourceType, Set<String>>();
+	private static Map<ResourceType, Set<String>> extensionsDenied = new HashMap<ResourceType, Set<String>>();
 
 	static {
 		// load defaults
-		extensionsAllowed.put(ResourceTypeHandler.FILE, Utils.getSet(PropertiesLoader
+		extensionsAllowed.put(ResourceType.FILE, Utils.getSet(PropertiesLoader
 		    .getProperty("connector.resourceType.file.extensions.allowed")));
-		extensionsDenied.put(ResourceTypeHandler.FILE, Utils.getSet(PropertiesLoader
+		extensionsDenied.put(ResourceType.FILE, Utils.getSet(PropertiesLoader
 		    .getProperty("connector.resourceType.file.extensions.denied")));
-		extensionsAllowed.put(ResourceTypeHandler.MEDIA, Utils.getSet(PropertiesLoader
+		extensionsAllowed.put(ResourceType.MEDIA, Utils.getSet(PropertiesLoader
 		    .getProperty("connector.resourceType.media.extensions.allowed")));
-		extensionsDenied.put(ResourceTypeHandler.MEDIA, Utils.getSet(PropertiesLoader
+		extensionsDenied.put(ResourceType.MEDIA, Utils.getSet(PropertiesLoader
 		    .getProperty("connector.resourceType.media.extensions.denied")));
-		extensionsAllowed.put(ResourceTypeHandler.IMAGE, Utils.getSet(PropertiesLoader
+		extensionsAllowed.put(ResourceType.IMAGE, Utils.getSet(PropertiesLoader
 		    .getProperty("connector.resourceType.image.extensions.allowed")));
-		extensionsDenied.put(ResourceTypeHandler.IMAGE, Utils.getSet(PropertiesLoader
+		extensionsDenied.put(ResourceType.IMAGE, Utils.getSet(PropertiesLoader
 		    .getProperty("connector.resourceType.image.extensions.denied")));
-		extensionsAllowed.put(ResourceTypeHandler.FLASH, Utils.getSet(PropertiesLoader
+		extensionsAllowed.put(ResourceType.FLASH, Utils.getSet(PropertiesLoader
 		    .getProperty("connector.resourceType.flash.extensions.allowed")));
-		extensionsDenied.put(ResourceTypeHandler.FLASH, Utils.getSet(PropertiesLoader
+		extensionsDenied.put(ResourceType.FLASH, Utils.getSet(PropertiesLoader
 		    .getProperty("connector.resourceType.flash.extensions.denied")));
 	}
@@ -72,5 +72,5 @@
 	 * @return Set of allowed extensions or an empty set.
 	 */
-	public static Set<String> getExtensionsAllowed(final ResourceTypeHandler type) {
+	public static Set<String> getExtensionsAllowed(final ResourceType type) {
 		return extensionsAllowed.get(type);
 	}
@@ -87,5 +87,5 @@
 	 *            Required format: <code>ext1&#124;ext2&#124;ext3</code>
 	 */
-	public static void setExtensionsAllowed(final ResourceTypeHandler type, final String extensionsList) {
+	public static void setExtensionsAllowed(final ResourceType type, final String extensionsList) {
 		if (extensionsList != null) {
 			extensionsAllowed.put(type, Utils.getSet(extensionsList));
@@ -101,5 +101,5 @@
 	 * @return Set of denied extensions or an empty set.
 	 */
-	public static Set<String> getExtensionsDenied(final ResourceTypeHandler type) {
+	public static Set<String> getExtensionsDenied(final ResourceType type) {
 		return extensionsDenied.get(type);
 	}
@@ -116,5 +116,5 @@
 	 *            Required format: <code>ext1&#124;ext2&#124;ext3</code>
 	 */
-	public static void setExtensionsDenied(final ResourceTypeHandler type, final String extensionsList) {
+	public static void setExtensionsDenied(final ResourceType type, final String extensionsList) {
 		if (extensionsList != null) {
 			extensionsDenied.put(type, Utils.getSet(extensionsList));
@@ -134,5 +134,5 @@
 	 *         is always returned if 'type' or 'extensions' is <code>null</code>.
 	 */
-	public static boolean isAllowed(final ResourceTypeHandler type, final String extension) {
+	public static boolean isAllowed(final ResourceType type, final String extension) {
 		if (type == null || extension == null)
 			return false;
Index: FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/handlers/RequestCycleHandler.java
===================================================================
--- FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/handlers/RequestCycleHandler.java	(revision 2406)
+++ FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/handlers/RequestCycleHandler.java	(revision 2407)
@@ -23,4 +23,5 @@
 import javax.servlet.http.HttpServletRequest;
 
+import net.fckeditor.connector.Connector;
 import net.fckeditor.requestcycle.UserAction;
 import net.fckeditor.requestcycle.UserPathBuilder;
@@ -39,8 +40,9 @@
 	private static UserAction userAction = null;
 	private static UserPathBuilder userPathBuilder = null;
+	private static Connector connector = null;
 
 	static {
 		// If there are more objects to instantiate in future, we could solve the following by reflection!
-		
+				
 		// 1. try to instantiate the UserAction object
 		String fqcn = PropertiesLoader.getProperty("connector.userActionImpl");
@@ -73,4 +75,20 @@
 			}
 		}
+		
+		// 3. try to instantiate the Connector object
+		fqcn = PropertiesLoader.getProperty("connector.implementation");
+		if (fqcn == null)
+			logger.warn("No property found for Connector implementation, any user action will be disabled!");
+		else {
+			try {
+				Class<?> clazz = Class.forName(fqcn);
+				connector = (Connector) clazz.newInstance();
+				logger.info("Connector initialized to {}", connector.getClass());
+			} catch (Exception e) {
+				logger.error("Couldn't instantiate class [".concat(fqcn).concat(
+				        "], any user action will disabled!"), e);
+			}
+		}
+
 	}
 
@@ -104,14 +122,14 @@
 	 * 
 	 * @param request
-	 * @return {@link UserPathBuilder#getUserFilesPath(HttpServletRequest)} or
+	 * @return {@link UserPathBuilder#getUserFilesPath()} or
 	 *         <code>null</code> if <code>userPathBuilder</code> is
 	 *         <code>null</code>.
 	 */
-	public static String getUserFilePath(final HttpServletRequest request) {
-		return (userPathBuilder != null) ? userPathBuilder.getUserFilesPath(request) : null;
+	public static String getUserFilePath() {
+		return (userPathBuilder != null) ? userPathBuilder.getUserFilesPath() : null;
 	}
 	
-	public static String getLocalUserFilePath() {
-		return (userPathBuilder != null) ? userPathBuilder.getLocalUserFilesPath() : null;
+	public static Connector getConnector() {
+		return connector;
 	}
 }
Index: FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/handlers/ResourceType.java
===================================================================
--- FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/handlers/ResourceType.java	(revision 2407)
+++ FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/handlers/ResourceType.java	(revision 2407)
@@ -0,0 +1,132 @@
+/*
+ * 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.handlers;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import net.fckeditor.tool.Utils;
+
+/**
+ * Common resource type holder without any implementation (connector) specific stuff.
+ *
+ * @version $Id$
+ */
+public class ResourceType {
+	private String name;
+	private static Map<String, ResourceType> types = new HashMap<String, ResourceType>(4);
+	public static final ResourceType FILE = new ResourceType("file");
+	public static final ResourceType FLASH = new ResourceType("flash");
+	public static final ResourceType IMAGE = new ResourceType("image");
+	public static final ResourceType MEDIA = new ResourceType("media");
+	
+	static {
+		types.put(FILE.getName(), FILE);
+		types.put(FLASH.getName(), FLASH);
+		types.put(IMAGE.getName(), IMAGE);
+		types.put(MEDIA.getName(), MEDIA);
+	}
+	
+	private ResourceType(final String name) {
+		this.name = name;
+	}
+	
+	public String getName() {
+		return name;
+	}
+	
+	/**
+	 * Getter for a {@link ResourceType} for a specified string. <br>
+	 * The comparison isn't case sensitive!
+	 * 
+	 * @param name A resource type to retrieve.
+	 * @return A {@link ResourceType} object holding the value
+	 *         represented by the string argument.
+	 * @throws IllegalArgumentException
+	 *            If 'name' is <code>null</code>, empty, or does not exist.
+	 */
+	public static ResourceType valueOf(final String name) {
+		if (Utils.isEmpty(name))
+			throw new IllegalArgumentException();
+
+		ResourceType rt = types.get(name.toLowerCase());
+		if (rt == null)
+			throw new IllegalArgumentException();
+		return rt;
+	}
+	
+	/**
+	 * Checks if a specified string represents a valid resource type.<br>
+	 * The comparison isn't case sensitive!
+	 * 
+	 * @param name
+	 *            A resource type string to check.
+	 * @return <code>true</code> if the string representation is valid else
+	 *         <code>false</code>.
+	 */
+	public static boolean isValid(final String name) {
+		return (Utils.isEmpty(name)) ? false : types.containsKey(name.toLowerCase());
+	}
+
+	/**
+	 * A wrapper for {@link #valueOf(String)}. It returns <code>null</code>
+	 * instead of throwing an exception.<br>
+	 * The comparison isn't case sensitive!
+	 * 
+	 * @param name
+	 *            A resource type string to check.
+	 * @return A {@link ResourceType} object holding the value
+	 *         represented by the string argument, or <code>null</code>.
+	 */
+	public static ResourceType getResourceType(final String name) {
+		try {
+			return ResourceType.valueOf(name.toLowerCase());
+		} catch (Exception e) {
+			return null;
+		}
+	}
+	
+	/**
+	 * Tries to determine ResourceType from string and return {@link #FILE} if
+	 * provided string is invalid.<br><br>
+	 * The comparison isn't case sensitive!
+	 * 
+	 * @param name
+	 * @return resource type
+	 */
+	public static ResourceType getDefaultResourceType(final String name) {
+		ResourceType rt = getResourceType(name.toLowerCase());
+		return rt == null ? FILE : rt;
+	}
+	
+	/* (non-Javadoc)
+	 * @see java.lang.Object#equals(java.lang.Object)
+	 */
+	@Override
+	public boolean equals(Object obj) {
+		if (obj == null || !(obj instanceof ResourceType))
+			return false;
+		else {
+			ResourceType rt = (ResourceType)obj;
+			return name.equals(rt.getName());
+		}
+	}
+}
Index: FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/handlers/ResourceTypeHandler.java
===================================================================
--- FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/handlers/ResourceTypeHandler.java	(revision 2406)
+++ FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/handlers/ResourceTypeHandler.java	(revision 2407)
@@ -30,4 +30,5 @@
  * 
  * @version $Id$
+ * @deprecated
  */
 public class ResourceTypeHandler {
Index: FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/requestcycle/ThreadLocalData.java
===================================================================
--- FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/requestcycle/ThreadLocalData.java	(revision 2407)
+++ FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/requestcycle/ThreadLocalData.java	(revision 2407)
@@ -0,0 +1,52 @@
+/*
+ * 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.requestcycle;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * Container for {@link ThreadLocal}s.<br>
+ *
+ * @version $Id$
+ */
+public class ThreadLocalData {
+	private static ThreadLocal<HttpServletRequest> servletRequest = null;
+	
+	public static void beginRequest(final HttpServletRequest servletRequest) {
+		if (servletRequest == null)
+			throw new IllegalArgumentException();
+		if (ThreadLocalData.servletRequest == null)
+			ThreadLocalData.servletRequest = new ThreadLocal<HttpServletRequest>();
+		ThreadLocalData.servletRequest.set(servletRequest);
+	}
+	
+	public static HttpServletRequest getServletRequest() {
+		return (servletRequest == null) ? null : servletRequest.get();
+	}
+	
+	/**
+	 * Clear the ThreadLocals.<br>
+	 * <b>Important: To prevent memory leaks we have to make sure that this method is calling at the end of each request cycle!!!</b>
+	 */
+	public static void endRequest() {
+		servletRequest = null;
+	}
+}
Index: FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/requestcycle/UserPathBuilder.java
===================================================================
--- FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/requestcycle/UserPathBuilder.java	(revision 2406)
+++ FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/requestcycle/UserPathBuilder.java	(revision 2407)
@@ -44,10 +44,10 @@
 	 * <li>The path has to be within the context.</li>
 	 * </ul>
+	 * <strong>If your implementation needs {@link HttpServletRequest} e.g. to get a
+	 * session variable, you can get it by calling {@link ThreadLocalData#getServletRequest()}. </strong>
 	 * 
 	 * @param request
 	 * @return <code>UserFilesPath</code> for the current user.
 	 */
-	public String getUserFilesPath(final HttpServletRequest request);
-	
-	public String getLocalUserFilesPath();
+	public String getUserFilesPath();
 }
Index: FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/requestcycle/impl/ContextPathBuilder.java
===================================================================
--- FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/requestcycle/impl/ContextPathBuilder.java	(revision 2406)
+++ FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/requestcycle/impl/ContextPathBuilder.java	(revision 2407)
@@ -21,7 +21,6 @@
 package net.fckeditor.requestcycle.impl;
 
-import javax.servlet.http.HttpServletRequest;
-
 import net.fckeditor.handlers.ConnectorHandler;
+import net.fckeditor.requestcycle.ThreadLocalData;
 import net.fckeditor.requestcycle.UserPathBuilder;
 
@@ -35,21 +34,29 @@
 public class ContextPathBuilder implements UserPathBuilder {
 
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see net.fckeditor.requestcycle.UserPathBuilder#getUserFilesPath(javax.servlet.http.HttpServletRequest)
+	/* (non-Javadoc)
+	 * @see net.fckeditor.requestcycle.UserPathBuilder#getUserFilesPath()
 	 */
-	public String getUserFilesPath(final HttpServletRequest request) {
-		return request.getContextPath()
-				+ ConnectorHandler.getDefaultUserFilesPath();
-	}
-	
-	/*
-	 * (non-Javadoc)
-	 * @see net.fckeditor.requestcycle.UserPathBuilder#getLocalUserFilesPath()
-	 */
-	public String getLocalUserFilesPath() {
-		return ConnectorHandler.getDefaultUserFilesPath();
+	public String getUserFilesPath() {
+		return ThreadLocalData.getServletRequest().getContextPath().concat(ConnectorHandler.getDefaultUserFilesPath());
 	}
 
+//	/*
+//	 * (non-Javadoc)
+//	 * @see net.fckeditor.requestcycle.UserPathBuilder#getUserFilesPath(javax.servlet.http.HttpServletRequest)
+//	 * TODO why contextPath ???
+//	 */
+//	public String getUserFilesPath(final HttpServletRequest request) {
+//		return request.getContextPath()
+//				+ ConnectorHandler.getDefaultUserFilesPath();
+//	}
+//	
+//	/* ??????????????????
+//	 * (non-Javadoc)
+//	 * @see net.fckeditor.requestcycle.UserPathBuilder#getLocalUserFilesPath()
+//	 */
+//	public String getLocalUserFilesPath() {
+//		return ConnectorHandler.getDefaultUserFilesPath();
+//	}
+
+	
 }
Index: FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/response/GetResponse.java
===================================================================
--- FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/response/GetResponse.java	(revision 2407)
+++ FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/response/GetResponse.java	(revision 2407)
@@ -0,0 +1,277 @@
+/*
+ * 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.response;
+
+import java.io.StringWriter;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import net.fckeditor.handlers.CommandHandler;
+import net.fckeditor.handlers.LocalizedPropertiesLoader;
+import net.fckeditor.handlers.ResourceType;
+import net.fckeditor.requestcycle.ThreadLocalData;
+import net.fckeditor.tool.Utils;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+/**
+ * Creates an XML response for every <code>GET</code> request of the Connector
+ * servlet. This class maps directly to the XML layout described <a
+ * href="http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/Server_Side_Integration#The_Commands">here</a>.
+ *
+ * @version $Id$
+ */
+public class GetResponse {
+
+	private Document document;
+	private Element errorElement;
+	private Element foldersElement;
+	private Element filesElement;
+	
+	/** Error number OK */
+	public static final int EN_OK = 0;
+	
+	/** Error number ERROR */
+	public static final int EN_ERROR = 1;
+
+	/** Error number ALREADY EXISTS */
+	public static final int EN_ALREADY_EXISTS = 101;
+
+	/** Error number INVALID FOLDER NAME */
+	public static final int EN_INVALID_FOLDER_NAME = 102;
+
+	/** Error number SECURITY ERROR */
+	public static final int EN_SECURITY_ERROR = 103;
+
+	/** Error number UNKNOWN ERROR */
+	public static final int EN_UKNOWN = 110;
+	
+
+	/**
+	 * 
+	 * Use this constructor if want to respond a negative/error message with
+	 * custom text.
+	 * 
+	 * @param number
+	 * @param text
+	 */
+	public GetResponse(int number, String text) {
+		try {
+			DocumentBuilderFactory factory = DocumentBuilderFactory
+					.newInstance();
+			DocumentBuilder builder = factory.newDocumentBuilder();
+			document = builder.newDocument();
+		} catch (ParserConfigurationException e) {
+			throw new RuntimeException(e);
+		}
+
+		Element root = document.createElement("Connector");
+		document.appendChild(root);
+		setError(number, text);
+	}
+	
+	/**
+	 * Use this constructor if want to respond a positive message.
+	 * 
+	 * @param command
+	 * @param resourceType
+	 * @param currentFolder
+	 * @param constructedUrl
+	 */
+	public GetResponse(CommandHandler command, ResourceType resourceType, 
+			String currentFolder, String constructedUrl) {
+	
+		try {
+			DocumentBuilderFactory factory = DocumentBuilderFactory
+					.newInstance();
+			DocumentBuilder builder = factory.newDocumentBuilder();
+			document = builder.newDocument();
+		} catch (ParserConfigurationException e) {
+			throw new RuntimeException(e);
+		}
+	
+		Element root = document.createElement("Connector");
+		document.appendChild(root);
+		root.setAttribute("command", command.toString());
+		root.setAttribute("resourceType", resourceType.getName());
+	
+		Element currentFolderElement = document.createElement("CurrentFolder");
+		currentFolderElement.setAttribute("path", currentFolder);
+	
+		currentFolderElement.setAttribute("url", constructedUrl);
+		root.appendChild(currentFolderElement);
+	
+	}
+
+	/**
+	 * Use this constructor if want to respond a negative/error message only.
+	 * 
+	 * @param number
+	 */
+	public GetResponse(int number) {
+		this(number, null);
+	}
+	
+	/**
+	 * Sets an error number with a custom message.
+	 * 
+	 * @param number
+	 * @param text
+	 */
+	public void setError(int number, String text) {
+
+		if (errorElement == null) {
+			errorElement = document.createElement("Error");
+			document.getDocumentElement().appendChild(errorElement);
+		}
+
+		errorElement.setAttribute("number", String.valueOf(number));
+		if (Utils.isNotEmpty(text))
+			errorElement.setAttribute("text", text);
+
+	}
+
+	/**
+	 * Sets an error number.
+	 * 
+	 * @param number
+	 */
+	public void setError(int number) {
+		setError(number, null);
+	}
+
+	/**
+	 * Lists all folders as XML tags.
+	 * @param dir
+	 */
+	public void setFolders(final List<String> dirs) {
+
+		if (foldersElement != null) {
+			Element parent = (Element) foldersElement.getParentNode();
+			parent.removeChild(foldersElement);
+		}
+
+		foldersElement = document.createElement("Folders");
+		document.getDocumentElement().appendChild(foldersElement);
+
+		for (String file : dirs) {
+			Element folderElement = document.createElement("Folder");
+			folderElement.setAttribute("name", file);
+			foldersElement.appendChild(folderElement);
+		}
+	}
+	
+	/**
+	 * Lists all files XML tags.
+	 * 
+	 * @param Map, key is the file name and value is the size of the file in bytes
+	 */
+	public void setFiles(final Map<String, Long> files) {
+		
+		if (filesElement != null) {
+			Element parent = (Element) filesElement.getParentNode();
+			parent.removeChild(filesElement);
+		}
+
+		filesElement = document.createElement("Files");
+		document.getDocumentElement().appendChild(filesElement);
+		
+		long length;
+		long tempLength;
+		for (String fileName : files.keySet()) {
+			Element fileElement = document.createElement("File");
+			fileElement.setAttribute("name", fileName);
+			tempLength = files.get(fileName).longValue();
+			if (tempLength < 1024)
+				length = 1L;
+			else 
+				length = tempLength/1024;
+			fileElement.setAttribute("size", String.valueOf(length));
+			filesElement.appendChild(fileElement);
+		}
+	}
+	
+	@Override
+	public String toString() {
+		document.getDocumentElement().normalize();
+		TransformerFactory factory = TransformerFactory.newInstance();
+
+		StringWriter sw = new StringWriter();
+
+		try {
+			Transformer transformer = factory.newTransformer();
+
+			DOMSource source = new DOMSource(document);
+			StreamResult result = new StreamResult(sw);
+
+			transformer.transform(source, result);
+		} catch (TransformerException e) {
+			throw new RuntimeException(e);
+		}
+
+		return sw.toString();
+	}
+	
+	public static GetResponse getOK() {
+		return new GetResponse(EN_OK);
+	}
+	
+	public static GetResponse getErrorInvalidFolderName() {
+		return new GetResponse(EN_INVALID_FOLDER_NAME);
+	}
+	
+	public static GetResponse getErrorInvalidCommand() {
+		LocalizedPropertiesLoader lpl = LocalizedPropertiesLoader.getInstance(ThreadLocalData.getServletRequest());
+		return new GetResponse(EN_ERROR, lpl.getInvalidCommand());
+	}
+	
+	public static GetResponse getErrorInvalidType() {
+		LocalizedPropertiesLoader lpl = LocalizedPropertiesLoader.getInstance(ThreadLocalData.getServletRequest());
+		return new GetResponse(EN_ERROR, lpl.getInvalidType());
+	}
+	
+	public static GetResponse getErrorInvalidCurrentFolder() {
+		LocalizedPropertiesLoader lpl = LocalizedPropertiesLoader.getInstance(ThreadLocalData.getServletRequest());
+		return new GetResponse(EN_ERROR, lpl.getInvalidCurrentFolder());
+	}
+	
+	public static GetResponse getErrorFolderAlreadyExists() {
+		return new GetResponse(EN_ALREADY_EXISTS);
+	}
+	
+	public static GetResponse getErrorSecurity() {
+		return new GetResponse(EN_SECURITY_ERROR);
+	}
+	
+	public static GetResponse getErrorUnknown() {
+		return new GetResponse(EN_UKNOWN);
+	}
+}
Index: FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/response/UploadResponse.java
===================================================================
--- FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/response/UploadResponse.java	(revision 2406)
+++ FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/response/UploadResponse.java	(revision 2407)
@@ -21,4 +21,6 @@
 package net.fckeditor.response;
 
+import net.fckeditor.handlers.LocalizedPropertiesLoader;
+import net.fckeditor.requestcycle.ThreadLocalData;
 import net.fckeditor.tool.Utils;
 
@@ -123,4 +125,27 @@
 		}
 	}
+	
+	public static UploadResponse getErrorSecurity() {
+		return new UploadResponse(SC_SECURITY_ERROR);
+	}
+	
+	public static UploadResponse getErrorInvalidExtension() {
+		return new UploadResponse(SC_INVALID_EXTENSION);
+	}
+	
+	public static UploadResponse getErrorInvalidCommand() {
+		LocalizedPropertiesLoader lpl = LocalizedPropertiesLoader.getInstance(ThreadLocalData.getServletRequest());
+		return new UploadResponse(SC_ERROR, null, null, lpl.getInvalidCommand());
+	}
+	
+	public static UploadResponse getErrorInvalidType() {
+		LocalizedPropertiesLoader lpl = LocalizedPropertiesLoader.getInstance(ThreadLocalData.getServletRequest());
+		return new UploadResponse(SC_ERROR, null, null, lpl.getInvalidType());
+	}
+	
+	public static UploadResponse getErrorInvalidCurrentFolder() {
+		LocalizedPropertiesLoader lpl = LocalizedPropertiesLoader.getInstance(ThreadLocalData.getServletRequest());
+		return new UploadResponse(SC_ERROR, null, null, lpl.getInvalidCurrentFolder());
+	}
 
 	/**
@@ -132,8 +157,6 @@
 		sb.append("<script type=\"text/javascript\">\n");
 		// Compressed version of the document.domain automatic fix script.
-		// The original script can be found at [fckeditor
-		// dir]/_dev/domain_fix_template.js
-		sb
-				.append("(function(){var d=document.domain;while (true){try{var A=window.parent.document.domain;break;}catch(e) {};d=d.replace(/.*?(?:\\.|$)/,'');if (d.length==0) break;try{document.domain=d;}catch (e){break;}}})();\n");
+		// The original script can be found at [fckeditor_dir]/_dev/domain_fix_template.js
+		sb.append("(function(){var d=document.domain;while (true){try{var A=window.parent.document.domain;break;}catch(e) {};d=d.replace(/.*?(?:\\.|$)/,'');if (d.length==0) break;try{document.domain=d;}catch (e){break;}}})();\n");
 		sb.append("window.parent.OnUploadCompleted(");
 
Index: FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/response/XmlResponse.java
===================================================================
--- FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/response/XmlResponse.java	(revision 2406)
+++ FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/response/XmlResponse.java	(revision 2407)
@@ -49,5 +49,5 @@
  * 
  * @version $Id$
- * 
+ * @deprecated
  */
 public class XmlResponse {
Index: FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/tool/UtilsFile.java
===================================================================
--- FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/tool/UtilsFile.java	(revision 2406)
+++ FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/tool/UtilsFile.java	(revision 2407)
@@ -24,5 +24,5 @@
 import java.io.InputStream;
 
-import javax.servlet.http.HttpServletRequest;
+import net.fckeditor.handlers.ConnectorHandler;
 
 import org.apache.commons.io.FilenameUtils;
@@ -30,8 +30,4 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-
-import net.fckeditor.handlers.ConnectorHandler;
-import net.fckeditor.handlers.RequestCycleHandler;
-import net.fckeditor.handlers.ResourceTypeHandler;
 
 /**
@@ -149,19 +145,3 @@
 		}
 	}
-	
-	/**
-	 * Compose server-side response path.
-	 * 
-	 * @param request
-	 * @param resourceType
-	 * @return server-side path of <code>resourceType</code>.
-	 */
-	public static String constructServerSidePath(HttpServletRequest request,
-			ResourceTypeHandler resourceType) {
-		StringBuffer sb = new StringBuffer(RequestCycleHandler.getLocalUserFilePath());
-		sb.append(resourceType.getPath());
-
-		return sb.toString();
-	}
-
 }
Index: FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/tool/UtilsResponse.java
===================================================================
--- FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/tool/UtilsResponse.java	(revision 2406)
+++ FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/tool/UtilsResponse.java	(revision 2407)
@@ -24,5 +24,6 @@
 
 import net.fckeditor.handlers.ConnectorHandler;
-import net.fckeditor.handlers.ResourceTypeHandler;
+import net.fckeditor.handlers.ResourceType;
+import net.fckeditor.requestcycle.ThreadLocalData;
 
 /**
@@ -35,31 +36,24 @@
 	/**
 	 * Constructs a URL from different parameters. This method is about to
-	 * change in version 2.5.
-	 * 
-	 * @param request
-	 * @param resourceType
-	 * @param urlPath
-	 * @param fullUrl
-	 * @return constructed url
+	 * change in version 2.5. 
+	 * TODO {@link ConnectorHandler#getUserFilesPath()} call has to be eliminated, because it could contains absolute paths in future ! ???
 	 */
-    public static String constructResponseUrl(HttpServletRequest request,
-    		ResourceTypeHandler resourceType, String urlPath,
-    		boolean fullUrl) {
-    		
-    	StringBuffer sb = new StringBuffer();
-    	
-    	if (fullUrl) {
-    		String address = request.getRequestURL().toString();
-    		sb.append(address.substring(0, address.indexOf('/', 8)));
-    	}
-    	    	
-    	sb.append(ConnectorHandler.getUserFilesPath(request));
-    	sb.append(resourceType.getPath());
-    	
-    	if (Utils.isNotEmpty(urlPath))
-    		sb.append(urlPath);
-    	
-    	return sb.toString();
-    }
+	public static String constructResponseUrl(ResourceType resourceType, String resourceTypePath, String urlPath) {
+		HttpServletRequest request = ThreadLocalData.getServletRequest();
+		StringBuffer sb = new StringBuffer();
+		
+		if ( ConnectorHandler.isFullUrl()) {
+			String address = request.getRequestURL().toString();
+			sb.append(address.substring(0, address.indexOf('/', 8)));
+		}
+		    	
+		sb.append(ConnectorHandler.getUserFilesPath());
+		sb.append(resourceTypePath);
+		
+		if (Utils.isNotEmpty(urlPath))
+			sb.append(urlPath);
+		
+		return sb.toString();
+	}
 
 }
Index: FCKeditor.Java/branches/2.5-test/java-core/src/test/java/net/fckeditor/handlers/ExtensionsHandlerTest.java
===================================================================
--- FCKeditor.Java/branches/2.5-test/java-core/src/test/java/net/fckeditor/handlers/ExtensionsHandlerTest.java	(revision 2406)
+++ FCKeditor.Java/branches/2.5-test/java-core/src/test/java/net/fckeditor/handlers/ExtensionsHandlerTest.java	(revision 2407)
@@ -35,5 +35,5 @@
 	@Test
 	public void testIsAllowed01() {
-		ResourceTypeHandler type = ResourceTypeHandler.FILE;
+		ResourceType type = ResourceType.FILE;
 		ExtensionsHandler.setExtensionsAllowed(type, "a");
 		ExtensionsHandler.setExtensionsDenied(type, "b");
@@ -47,5 +47,5 @@
 	@Test
 	public void testIsAllowed02() {
-		ResourceTypeHandler type = ResourceTypeHandler.FILE;
+		ResourceType type = ResourceType.FILE;
 		ExtensionsHandler.setExtensionsAllowed(type, "a|b|c");
 		assertTrue(ExtensionsHandler.isAllowed(type, "a"));
Index: FCKeditor.Java/branches/2.5-test/java-demo/src/main/resources/fckeditor.properties
===================================================================
--- FCKeditor.Java/branches/2.5-test/java-demo/src/main/resources/fckeditor.properties	(revision 2406)
+++ FCKeditor.Java/branches/2.5-test/java-demo/src/main/resources/fckeditor.properties	(revision 2407)
@@ -1,1 +1,2 @@
 connector.userActionImpl=net.fckeditor.requestcycle.impl.UserActionImpl
+connector.implementation = net.fckeditor.connector.impl.SimpleFileSystemConnector
