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 2443)
+++ /FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/connector/Connector.java	(revision 2444)
@@ -23,19 +23,24 @@
 
 import java.io.InputStream;
+import java.util.List;
+import java.util.Map;
 
 import javax.servlet.ServletContext;
 
+import net.fckeditor.connector.exception.FolderAlreadyExistsException;
+import net.fckeditor.connector.exception.InvalidCurrentFolderException;
+import net.fckeditor.connector.exception.InvalidFolderNameException;
+import net.fckeditor.connector.exception.SecurityIssueException;
+import net.fckeditor.connector.exception.UnknownException;
 import net.fckeditor.handlers.ResourceType;
-import net.fckeditor.response.GetResponse;
-import net.fckeditor.response.UploadResponse;
 
 /**
  * Interface for all Connectors.<br>
+ * The Connector will be initialized by the {@link Dispatcher}. If an error is happened there are well-defined
+ * exceptions which could be thrown. So the {@link Dispatcher} can react according to it.
+ * <br><br>
  * Keep in mind that the {@link Dispatcher} verifies the request and redirects the relevant parameters
- * to the implementation of the connector and forwards the response of the Connector to {@link ConnectorServlet}.
- * That means, you don't need to check the basic parameters 'type' and 'currentFolder' against null.
- * <br>
- * <br>
- * TODO find a nice way to have #getFiles and #getFolder instead of #getFileAndFolders.
+ * to the different methods of the connector and forwards the response to {@link ConnectorServlet}.
+ * Therefore you don't need to check the basic parameters 'type' and 'currentFolder' against <code>null</code>.
  * 
  * @version $Id$
@@ -46,14 +51,41 @@
 	 * Initializes the connector. This method will be called on the start of the webapp.
 	 * 
-	 * @param servletContext to get the real path for example.
+	 * @param servletContext eg. to get the real path of a file for example.
 	 */
 	public void init(final ServletContext servletContext);
+
+	/**
+	 * Returns a list of folder names which are inside the abstract path
+	 * <code>/[type-folder]/[currentFolder]</code>.
+	 * 
+	 * @param type
+	 * @param currentFolder
+	 * @return A list of folder names.
+	 * @throws InvalidCurrentFolderException
+	 * @throws SecurityIssueException
+	 * @throws UnknownException
+	 */
+	public Map<String, Long> getFiles(final ResourceType type, final String currentFolder)
+		throws InvalidCurrentFolderException, SecurityIssueException, UnknownException;
 	
-	public GetResponse getFolders(final ResourceType type, final String currentFolder);
+	/**
+	 * Returns a list of file names which are inside the abstract path
+	 * <code>/[type-folder]/[currentFolder]</code>.
+	 * 
+	 * @param type
+	 * @param currentFolder
+	 * @return A list of file names.
+	 * @throws InvalidCurrentFolderException
+	 * @throws SecurityIssueException
+	 * @throws UnknownException
+	 */
+	public List<String> getFolders(final ResourceType type, final String currentFolder)
+		throws InvalidCurrentFolderException, SecurityIssueException, UnknownException;
+		
+	public void createFolder(final ResourceType type, final String currentFolder, final String newFolder) 
+		throws InvalidCurrentFolderException, SecurityIssueException, InvalidFolderNameException, FolderAlreadyExistsException, UnknownException;
+
 	
-	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, final InputStream inputStream);
+	public String fileUpload(final ResourceType type, final String currentFolder, final String fileName, final InputStream inputStream)
+		throws InvalidCurrentFolderException, SecurityIssueException;
 }
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 2443)
+++ /FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/connector/ConnectorServlet.java	(revision 2444)
@@ -28,5 +28,4 @@
 import javax.servlet.http.HttpServletResponse;
 
-import net.fckeditor.handlers.RequestCycleHandler;
 import net.fckeditor.requestcycle.ThreadLocalData;
 
@@ -34,6 +33,5 @@
  * This is the FCKeditor servlet. It has the following jobs:
  * <ul>
- * <li>Initialization of the {@link Dispatcher}-object. It refers the request to
- * the {@link Connector}s implementation.</li>
+ * <li>Initialization of the {@link Dispatcher}-object.</li>
  * <li>Calling {@link ThreadLocalData#beginRequest(HttpServletRequest)}
  * (It is an object that holds request-based objects.)</li>
@@ -64,5 +62,5 @@
 	@Override
 	public void init() throws ServletException {
-		dispatcher = new Dispatcher(getServletContext(), RequestCycleHandler.getConnector());
+		dispatcher = new Dispatcher(getServletContext());
 	}
 	
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 2443)
+++ /FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/connector/Dispatcher.java	(revision 2444)
@@ -29,6 +29,12 @@
 import javax.servlet.http.HttpServletResponse;
 
+import net.fckeditor.connector.exception.FolderAlreadyExistsException;
+import net.fckeditor.connector.exception.InvalidCurrentFolderException;
+import net.fckeditor.connector.exception.InvalidFolderNameException;
+import net.fckeditor.connector.exception.SecurityIssueException;
+import net.fckeditor.connector.exception.UnknownException;
 import net.fckeditor.handlers.CommandHandler;
 import net.fckeditor.handlers.ConnectorHandler;
+import net.fckeditor.handlers.ExtensionsHandler;
 import net.fckeditor.handlers.RequestCycleHandler;
 import net.fckeditor.handlers.ResourceType;
@@ -37,4 +43,5 @@
 import net.fckeditor.tool.Utils;
 import net.fckeditor.tool.UtilsFile;
+import net.fckeditor.tool.UtilsResponse;
 
 import org.apache.commons.fileupload.FileItem;
@@ -48,6 +55,9 @@
 
 /**
- * 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.
+ * 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.)<br>
+ * If errors are happened inside the methods of the {@link Connector} well defined exceptions 
+ * from {@link net.fckeditor.connector.exception} will be thrown. These exceptions will be catched
+ * and converted into corresponding response objects.
  * 
  * @version $Id$
@@ -57,6 +67,11 @@
 	private Connector connector = null;
 	
-	protected Dispatcher(final ServletContext servletContext, final Connector connector) {
-		this.connector = connector;
+	/**
+	 * Initializes the {@link Connector}.
+	 * 
+	 * @param servletContext
+	 */
+	protected Dispatcher(final ServletContext servletContext) {
+		this.connector = RequestCycleHandler.getConnector();
 		this.connector.init(servletContext);
 	}
@@ -90,5 +105,5 @@
 		logger.debug("Parameter CurrentFolder: {}", currentFolderStr);
 		
-		GetResponse getResponse;
+		GetResponse getResponse = null;
 		// check parameters
 		if (!CommandHandler.isValidForGet(commandStr))
@@ -109,20 +124,37 @@
 			else if (command.equals(CommandHandler.CREATE_FOLDER) && !RequestCycleHandler.isEnabledForFolderCreation())
 				getResponse = GetResponse.getErrorFolderCreationDisabled();
-
-			// call the right Connector method depending on the command
-			else 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"));
-				if (Utils.isEmpty(newFolderStr))
+			
+			else {
+				
+				// make the connector calls, catch its exceptions and generate the right response object
+				try {
+					if (command.equals(CommandHandler.CREATE_FOLDER)) {
+						String newFolderStr = UtilsFile.sanitizeFolderName(request.getParameter("NewFolderName"));
+						if (Utils.isEmpty(newFolderStr))
+							getResponse = GetResponse.getErrorInvalidFolderName();
+						else {
+							logger.debug("Parameter NewFolderName: {}", newFolderStr);
+							connector.createFolder(type, currentFolderStr, newFolderStr);
+							getResponse = GetResponse.getOK();
+						}
+					} else if (command.equals(CommandHandler.GET_FOLDERS) || command.equals(CommandHandler.GET_FOLDERS_AND_FILES)) {
+						String responseUrl = UtilsResponse.constructResponseUrl( 
+								ConnectorHandler.getUserFilesPath(),
+								"/".concat(typeStr.toLowerCase()), currentFolderStr);
+						getResponse = getFileAndFolders(command, type, currentFolderStr, responseUrl);
+					} else 
+						getResponse = GetResponse.getErrorUnknown();
+				} catch (InvalidCurrentFolderException e) {
+					getResponse = GetResponse.getErrorInvalidCurrentFolder();
+				} catch (SecurityIssueException e) {
+					getResponse = GetResponse.getErrorSecurity();
+				} catch (InvalidFolderNameException e) {
 					getResponse = GetResponse.getErrorInvalidFolderName();
-				else {
-					logger.debug("Parameter NewFolderName: {}", newFolderStr);
-					getResponse = connector.createFolder(type, currentFolderStr, newFolderStr);
+				} catch (FolderAlreadyExistsException e) {
+					getResponse = GetResponse.getErrorFolderAlreadyExists();
+				} catch (Exception e) {
+					getResponse = GetResponse.getErrorUnknown();
 				}
-			} else 
-				getResponse = GetResponse.getErrorUnknown();
+			}
 		}
 		
@@ -132,5 +164,27 @@
 		logger.debug("Exiting Dispatcher#doGet");
 	}
-
+	
+	/**
+	 * Helper to make the right {@link Connector}-calls for <code>GetFolders</code> and
+	 * <code>GetFoldersAndFiles</code>.
+	 * 
+	 * @param command should be only {@link CommandHandler#GET_FOLDERS} or {@link CommandHandler#GET_FOLDERS_AND_FILES}!!
+	 * @param type
+	 * @param currentFolderStr
+	 * @param responseUrl
+	 * @return
+	 * @throws InvalidCurrentFolderException
+	 * @throws SecurityIssueException
+	 * @throws UnknownException
+	 */
+	private GetResponse getFileAndFolders(final CommandHandler command, final ResourceType type, final String currentFolderStr, final String responseUrl)
+			throws InvalidCurrentFolderException, SecurityIssueException, UnknownException {
+		GetResponse getResponse = new GetResponse(command, type, currentFolderStr, responseUrl);
+		getResponse.setFolders(connector.getFolders(type, currentFolderStr));
+		if (command.equals(CommandHandler.GET_FOLDERS_AND_FILES)) 
+			getResponse.setFiles(connector.getFiles(type, currentFolderStr));
+		return getResponse;
+	}
+	
 	/**
 	 * Manage the <code>POST</code> requests (<code>FileUpload</code>).<br />
@@ -188,13 +242,26 @@
 				// We upload just one file at the same time
 				FileItem uplFile = items.get(0);
+				// check the extension
+				if (!ExtensionsHandler.isAllowed(type, FilenameUtils.getExtension(uplFile.getName())))
+					uploadResponse = UploadResponse.getErrorInvalidExtension();
 				// Secure image check
-				if (type.equals(ResourceType.IMAGE) && ConnectorHandler.isSecureImageUploads()
-						&& !UtilsFile.isImage(uplFile.getInputStream())) {
+				else 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.getInputStream());
+					String newFileName = connector.fileUpload(type, currentFolderStr, fileName, uplFile.getInputStream());
+					String responseUrl = UtilsResponse.constructResponseUrl( 
+							ConnectorHandler.getUserFilesPath(),
+							"/".concat(typeStr.toLowerCase()), currentFolderStr);
+					if (fileName.equals(newFileName))
+						uploadResponse = new UploadResponse(UploadResponse.SC_OK, responseUrl);
+					else
+						uploadResponse =  new UploadResponse(UploadResponse.SC_RENAMED, responseUrl, newFileName); 
 				}
 				uplFile.delete();
+			} catch (InvalidCurrentFolderException e) {
+				uploadResponse = UploadResponse.getErrorInvalidCurrentFolder();
+			} catch (SecurityIssueException e) {
+				uploadResponse = UploadResponse.getErrorSecurity();
 			} catch (Exception e) {
 				uploadResponse = UploadResponse.getErrorSecurity();
Index: /FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/connector/exception/FolderAlreadyExistsException.java
===================================================================
--- /FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/connector/exception/FolderAlreadyExistsException.java	(revision 2444)
+++ /FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/connector/exception/FolderAlreadyExistsException.java	(revision 2444)
@@ -0,0 +1,30 @@
+/*
+ * 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.exception;
+
+/**
+ * TODO FolderAlreadyExistsException.java - document me 
+ *
+ * @version $Id$
+ */
+public class FolderAlreadyExistsException extends Exception {
+
+}
Index: /FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/connector/exception/InvalidCurrentFolderException.java
===================================================================
--- /FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/connector/exception/InvalidCurrentFolderException.java	(revision 2444)
+++ /FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/connector/exception/InvalidCurrentFolderException.java	(revision 2444)
@@ -0,0 +1,30 @@
+/*
+ * 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.exception;
+
+/**
+ * TODO InvalidCurrentFolderException.java - document me 
+ *
+ * @version $Id$
+ */
+public class InvalidCurrentFolderException extends Exception {
+
+}
Index: /FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/connector/exception/InvalidExtensionErrorException.java
===================================================================
--- /FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/connector/exception/InvalidExtensionErrorException.java	(revision 2444)
+++ /FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/connector/exception/InvalidExtensionErrorException.java	(revision 2444)
@@ -0,0 +1,30 @@
+/*
+ * 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.exception;
+
+/**
+ * TODO InvalidExtensionError.java - document me 
+ *
+ * @version $Id$
+ */
+public class InvalidExtensionErrorException extends Exception {
+
+}
Index: /FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/connector/exception/InvalidFolderNameException.java
===================================================================
--- /FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/connector/exception/InvalidFolderNameException.java	(revision 2444)
+++ /FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/connector/exception/InvalidFolderNameException.java	(revision 2444)
@@ -0,0 +1,30 @@
+/*
+ * 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.exception;
+
+/**
+ * TODO InvalidFolderName.java - document me 
+ *
+ * @version $Id$
+ */
+public class InvalidFolderNameException extends Exception {
+
+}
Index: /FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/connector/exception/SecurityIssueException.java
===================================================================
--- /FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/connector/exception/SecurityIssueException.java	(revision 2444)
+++ /FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/connector/exception/SecurityIssueException.java	(revision 2444)
@@ -0,0 +1,30 @@
+/*
+ * 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.exception;
+
+/**
+ * TODO SecurityException.java - document me 
+ *
+ * @version $Id$
+ */
+public class SecurityIssueException extends Exception {
+
+}
Index: /FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/connector/exception/UnknownException.java
===================================================================
--- /FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/connector/exception/UnknownException.java	(revision 2444)
+++ /FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/connector/exception/UnknownException.java	(revision 2444)
@@ -0,0 +1,30 @@
+/*
+ * 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.exception;
+
+/**
+ * TODO UnknownException.java - document me 
+ *
+ * @version $Id$
+ */
+public class UnknownException extends Exception {
+
+}
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 2443)
+++ /FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/connector/impl/SimpleFileSystemConnector.java	(revision 2444)
@@ -34,13 +34,13 @@
 
 import net.fckeditor.connector.Connector;
-import net.fckeditor.handlers.CommandHandler;
+import net.fckeditor.connector.exception.FolderAlreadyExistsException;
+import net.fckeditor.connector.exception.InvalidCurrentFolderException;
+import net.fckeditor.connector.exception.InvalidFolderNameException;
+import net.fckeditor.connector.exception.SecurityIssueException;
+import net.fckeditor.connector.exception.UnknownException;
 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;
@@ -87,12 +87,11 @@
 	 * @see net.fckeditor.connector.Connector#fileUpload(net.fckeditor.handlers.ResourceType, java.lang.String, java.lang.String, java.io.InputStream)
 	 */
-	public UploadResponse fileUpload(final ResourceType type, final String currentFolder, final String fileName, final InputStream inputStream) {
-		if (!ExtensionsHandler.isAllowed(type, FilenameUtils.getExtension(fileName)))
-			return UploadResponse.getErrorInvalidExtension();
+	public String fileUpload(final ResourceType type, final String currentFolder, final String fileName, final InputStream inputStream) 
+			throws InvalidCurrentFolderException, SecurityIssueException {
 		String baseDir = ConnectorHandler.getDefaultUserFilesPath();
 		File typeDir = getAndCreateResourceTypeDir(baseDir, type);
 		File currentDir = new File(typeDir, currentFolder);
 		if (!currentDir.exists())
-			return UploadResponse.getErrorInvalidCurrentFolder();
+			throw new InvalidCurrentFolderException();
 		File newFile = new File(currentDir, fileName);
 		File fileToSave = getUniqueFile(newFile.getAbsoluteFile());
@@ -101,14 +100,7 @@
 			IOUtils.copyLarge(inputStream, out);
 		} catch (Exception e) {
-			return UploadResponse.getErrorSecurity();
+			throw new SecurityIssueException();
 		}
-		String responseUrl = UtilsResponse.constructResponseUrl(paths.get(type), ConnectorHandler.getUserFilesPath(), 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;
+		return fileToSave.getName();
 	}
 	
@@ -116,34 +108,20 @@
 	 * @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) {
+	public void createFolder(final ResourceType type, final String currentFolder, final String newFolder) 
+			throws InvalidCurrentFolderException, SecurityIssueException, InvalidFolderNameException, FolderAlreadyExistsException, UnknownException {
 		String baseDir = ConnectorHandler.getDefaultUserFilesPath();
 		File typeDir = getAndCreateResourceTypeDir(baseDir, type);
 		File currentDir = new File(typeDir, currentFolder);
 		if (!currentDir.exists())
-			return GetResponse.getErrorInvalidCurrentFolder();
+			throw new InvalidCurrentFolderException();
 		File newDir = new File(currentDir, newFolder);
 		if (newDir.exists())
-			return GetResponse.getErrorFolderAlreadyExists();
+			throw new FolderAlreadyExistsException();
 		try {
-			return (newDir.mkdir()) ? GetResponse.getOK() : GetResponse.getErrorInvalidFolderName();
+			if (!newDir.mkdir()) 
+				throw new InvalidFolderNameException();
 		} catch (SecurityException e) {
-			return GetResponse.getErrorSecurity();
+			throw new SecurityIssueException();
 		}
-	}
-
-	/* (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(paths.get(type), ConnectorHandler.getUserFilesPath(), currentFolder));
-		getResponse.setFolders(getFolders(currentDir));
-		return getResponse;
 	}
 
@@ -151,30 +129,46 @@
 	 * @see net.fckeditor.connector.Connector#getFiles(net.fckeditor.handlers.ResourceType, java.lang.String)
 	 */
-	public GetResponse getFilesAndFolders(final ResourceType type, final String currentFolder) {
+	public Map<String, Long> getFiles(ResourceType type, String currentFolder)
+			throws InvalidCurrentFolderException, SecurityIssueException, UnknownException {
 		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(paths.get(type), ConnectorHandler.getUserFilesPath(), currentFolder));
-		getResponse.setFolders(getFolders(currentDir));
+			throw new InvalidCurrentFolderException();
+
 		// 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()));
+		Map<String, Long> files;
+		try {
+			File[] fileList = currentDir.listFiles((FileFilter) FileFileFilter.FILE);
+			files = new HashMap<String, Long>(fileList.length);
+			for (File file : fileList)
+				files.put(file.getName(), new Long(file.length()));
+			return files;
+		} catch (SecurityException e) {
+			throw new SecurityIssueException();
 		}
-		getResponse.setFiles(files);
-		return getResponse;
 	}
-	
-	private static List<String> getFolders(final File currentDir) {
+
+
+	/* (non-Javadoc)
+	 * @see net.fckeditor.connector.Connector#getFolders(net.fckeditor.handlers.ResourceType, java.lang.String)
+	 */
+	public  List<String> getFolders(final ResourceType type, final String currentFolder)
+			throws InvalidCurrentFolderException, SecurityIssueException, UnknownException {
+		String baseDir = ConnectorHandler.getDefaultUserFilesPath();
+		File typeDir = getAndCreateResourceTypeDir(baseDir, type);
+		File currentDir = new File(typeDir, currentFolder);
+		if (!currentDir.exists())
+			throw new InvalidCurrentFolderException();
 		if (!currentDir.isDirectory())
-			throw new IllegalArgumentException();
-		String[] fileList = currentDir.list(DirectoryFileFilter.DIRECTORY);
-		return Arrays.asList(fileList);
+			throw new UnknownException();
+		try {
+			String[] fileList = currentDir.list(DirectoryFileFilter.DIRECTORY);
+			return Arrays.asList(fileList);
+		} catch (Exception e) {
+			throw new SecurityIssueException();
+		}
 	}
+
 	
 	private static File getAndCreateResourceTypeDir(final String baseDir, final ResourceType type) {
Index: /FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/handlers/LocalizedPropertiesLoader.java
===================================================================
--- /FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/handlers/LocalizedPropertiesLoader.java	(revision 2443)
+++ /FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/handlers/LocalizedPropertiesLoader.java	(revision 2444)
@@ -30,8 +30,8 @@
 import javax.servlet.http.HttpServletRequest;
 
+import net.fckeditor.localization.LocaleResolver;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-
-import net.fckeditor.localization.LocaleResolver;
 
 /**
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 2443)
+++ /FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/requestcycle/UserPathBuilder.java	(revision 2444)
@@ -51,3 +51,11 @@
 	 */
 	public String getUserFilesPath();
+	
+	/**
+	 * Path needed to map resources to paths outside context of your webapp.
+	 * If the implementation don't bother you, just return <code>null</code>.
+	 * 
+	 * @return
+	 */
+	public String getLocalUserFilesPath();
 }
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 2443)
+++ /FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/requestcycle/impl/ContextPathBuilder.java	(revision 2444)
@@ -40,12 +40,18 @@
 		return ThreadLocalData.getServletRequest().getContextPath().concat(ConnectorHandler.getDefaultUserFilesPath());
 	}
+
+	/* (non-Javadoc)
+	 * @see net.fckeditor.requestcycle.UserPathBuilder#getUrlPath()
+	 */
+	public String getUrlPath() {
+		return null;
+	}
 	
-//	/* ??????????????????
-//	 * (non-Javadoc)
-//	 * @see net.fckeditor.requestcycle.UserPathBuilder#getLocalUserFilesPath()
-//	 */
-//	public String getLocalUserFilesPath() {
-//		return 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 2443)
+++ /FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/response/GetResponse.java	(revision 2444)
@@ -207,5 +207,5 @@
 		long length;
 		long tempLength;
-		for (String fileName : files.keySet()) {
+		for (String fileName : files.keySet()) { // TODO should we ordered the file names?
 			Element fileElement = document.createElement("File");
 			fileElement.setAttribute("name", fileName);
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 2443)
+++ /FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/tool/UtilsResponse.java	(revision 2444)
@@ -37,5 +37,5 @@
 	 * change in version 2.5. 
 	 */
-	public static String constructResponseUrl(String resourceTypePath, String filePath, String urlPath) {
+	public static String constructResponseUrl(String filePath, String resourceTypePath, String urlPath) {
 		HttpServletRequest request = ThreadLocalData.getServletRequest();
 		StringBuffer sb = new StringBuffer();
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 2443)
+++ /FCKeditor.Java/branches/2.5-test/java-demo/src/main/resources/fckeditor.properties	(revision 2444)
@@ -1,2 +1,2 @@
-connector.userActionImpl=net.fckeditor.requestcycle.impl.UserActionImpl
-connector.implementation = net.fckeditor.connector.impl.SimpleFileSystemConnector
+connector.userActionImpl=net.fckeditor.requestcycle.impl.FalseUserAction
+connector.implementation=net.fckeditor.connector.impl.SimpleFileSystemConnector
