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 2418)
+++ /FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/connector/Connector.java	(revision 2419)
@@ -22,4 +22,6 @@
 
 
+import java.io.InputStream;
+
 import javax.servlet.ServletContext;
 
@@ -29,8 +31,11 @@
 
 /**
- * TODO Connector.java - document me 
- *
- * Hint: ResourceType and 'currentFolder' are checked by the caller
- * ({@link Dispatcher}.
+ * Interface for all Connectors.<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
  * 
  * @version $Id$
@@ -41,4 +46,4 @@
 	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);
+	public UploadResponse fileUpload(final ResourceType type, final String currentFolder, final String fileName, final InputStream inputStream);
 }
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 2418)
+++ /FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/connector/Dispatcher.java	(revision 2419)
@@ -189,6 +189,5 @@
 				} 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[]!!*/
+					uploadResponse = connector.fileUpload(type, currentFolderStr, fileName, uplFile.getInputStream());
 				}
 				uplFile.delete();
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 2418)
+++ /FCKeditor.Java/branches/2.5-test/java-core/src/main/java/net/fckeditor/connector/impl/SimpleFileSystemConnector.java	(revision 2419)
@@ -25,4 +25,5 @@
 import java.io.FileFilter;
 import java.io.FileOutputStream;
+import java.io.InputStream;
 import java.util.Arrays;
 import java.util.HashMap;
@@ -44,4 +45,5 @@
 
 import org.apache.commons.io.FilenameUtils;
+import org.apache.commons.io.IOUtils;
 import org.apache.commons.io.filefilter.DirectoryFileFilter;
 import org.apache.commons.io.filefilter.FileFileFilter;
@@ -50,8 +52,8 @@
 
 /**
- * Implementation of the {@link Connector} for the filesystem. All path are interpreted as sub-directories 
+ * Implementation of the {@link Connector} for the file system. All path are interpreted as sub-directories 
  * of the {@link ConnectorHandler#getUserFilesPath()}.<br>
  * 
- * TODO move the static methods into a util-class in package net.fckeditor.connector.impl ???
+ * TODO should we move the static methods into a util-class in package net.fckeditor.connector.impl ???
  * @version $Id$
  */
@@ -81,8 +83,9 @@
 	}
 	
-	/* (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) {
+
+	/* (non-Javadoc)
+	 * @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();
@@ -96,5 +99,5 @@
 		try {
 			BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(fileToSave));
-			out.write(data);
+			IOUtils.copyLarge(inputStream, out);
 		} catch (Exception e) {
 			return UploadResponse.getErrorSecurity();
@@ -169,4 +172,6 @@
 	
 	private static List<String> getFolders(final File currentDir) {
+		if (!currentDir.isDirectory())
+			throw new IllegalArgumentException();
 		String[] fileList = currentDir.list(DirectoryFileFilter.DIRECTORY);
 		return Arrays.asList(fileList);
