Index: /FCKeditor.Java/branches/2.4/src/main/java/net/fckeditor/ConfigurationHandler.java
===================================================================
--- /FCKeditor.Java/branches/2.4/src/main/java/net/fckeditor/ConfigurationHandler.java	(revision 1416)
+++ /FCKeditor.Java/branches/2.4/src/main/java/net/fckeditor/ConfigurationHandler.java	(revision 1417)
@@ -40,167 +40,198 @@
  */
 public class ConfigurationHandler {
-    private static final Logger logger = LoggerFactory.getLogger(ConfigurationHandler.class);
-
-    private static Properties defaultProperties = new Properties();
-    private static String baseDir;
-    private static IBaseDirProvider baseDirProvider = null;
-    private static String fckEditorDir;
-    private static String fckEditorHeight;
-    private static String fckEditorWidth;
-    private static String fckEditorToolbarSet;
-
-    static {
-	// load defaults
-	try {
-	    defaultProperties.load(new BufferedInputStream(ConfigurationHandler.class.getResourceAsStream("default.properties")));
-	} catch (IOException e) {
-	    logger.error("Error while loading the default properties", e);
-	    throw new RuntimeException("Can't load default properties", e);
-	}
-	baseDir = defaultProperties.getProperty("fckeditor.basedir");
-	fckEditorDir = defaultProperties.getProperty("fckeditor.dir");
-	fckEditorWidth = defaultProperties.getProperty("fckeditor.width");
-	fckEditorHeight = defaultProperties.getProperty("fckeditor.height");
-	fckEditorToolbarSet = defaultProperties.getProperty("fckeditor.toolbarset");
-	logger.info("Default properties loaded and initialized successfully");
-    }
-
-    /**
-     * Getter for the base dir (using for user files).
-     * 
-     * @return If the {@link IBaseDirProvider} is set, then it's dir getter is called, or base dir.
-     */
-    public static String getBaseDir() {
-	return (baseDirProvider != null) ? baseDirProvider.getDir() : baseDir;
-    }
-
-    /**
-     * Setter for the base dir (using for user files).
-     * 
-     * @param baseDir
-     *                relative to the context root (no leading or ending /).
-     */
-    public static void setBaseDir(final String baseDir) {
-	ConfigurationHandler.baseDir = baseDir;
-    }
-
-    /**
-     * Getter for the {@link IBaseDirProvider}.
-     * 
-     * @param baseDirProvider
-     */
-    public static void setBaseDirProvider(final IBaseDirProvider baseDirProvider) {
-	ConfigurationHandler.baseDirProvider = baseDirProvider;
-    }
-
-    /**
-     * Getter for the dir of the fckeditor.
-     * 
-     * @return Dir of the fckeditor relative to the context root.
-     */
-    public static String getFckEditorDir() {
-	return fckEditorDir;
-    }
-
-    /**
-     * Setter for the dir of the fckeditor.
-     * 
-     * @param fckEditorDir
-     *                relative to the context root (no leading or ending /).
-     */
-    public static void setFckEditorDir(final String fckEditorDir) {
-	ConfigurationHandler.fckEditorDir = fckEditorDir;
-    }
-
-    /**
-     * Getter for the default height of the fckeditor.
-     * 
-     * @return Default height of the fckeditor.
-     */
-    public static String getFckEditorHeight() {
-	return fckEditorHeight;
-    }
-
-    /**
-     * Setter for the default height of the fckeditor.
-     * 
-     * @param fckEditorHeight
-     *                the default height of the fckeditor.
-     */
-    public static void setFckEditorHeight(final String fckEditorHeight) {
-	ConfigurationHandler.fckEditorHeight = fckEditorHeight;
-    }
-
-    /**
-     * Getter for the default width of the fckeditor.
-     * 
-     * @return Default width of the fckeditor.
-     */
-    public static String getFckEditorWidth() {
-	return fckEditorWidth;
-    }
-
-    /**
-     * Setter for the default width of the fckeditor.
-     * 
-     * @param fckEditorWidth
-     *                the default width of the fckeditor.
-     */
-    public static void setFckEditorWidth(final String fckEditorWidth) {
-	ConfigurationHandler.fckEditorWidth = fckEditorWidth;
-    }
-
-    /**
-     * Getter of the name of the default toolbarset of the fckeditor.
-     * 
-     * @return Name of the default toolbar set.
-     */
-    public static String getFckEditorToolbarSet() {
-	return fckEditorToolbarSet;
-    }
-
-    /**
-     * Getter of the name of the default toolbarset of the fckeditor.
-     * 
-     * @param fckEditorToolbarSet
-     *                the name of the toolbarset.
-     */
-    public static void setFckEditorToolbarSet(final String fckEditorToolbarSet) {
-	ConfigurationHandler.fckEditorToolbarSet = fckEditorToolbarSet;
-    }
-    
-    /**
-     * Getter for a default property with the name 'key'.
-     * 
-     * @param key
-     * @return The required property or null, if doesn't exists.
-     */
-    public static String getDefaultProperty(final String key) {
-	return defaultProperties.getProperty(key);
-    }
-    
-    /**
-     * Getter for the dafault properties.
-     * 
-     * @return Default properties.
-     */
-    public static Properties getDefaultProperties() {
-	return defaultProperties;
-    }
-    
-    /**
-     * Getter for the sub dir name of a media type.
-     * 
-     * @param type
-     * @return The sub dir name of the requested type, or the default one ('file') 
-     * 		if 'type' is unknown or empty.
-     */
-    public static String getSubDirForType(final String type) {
-	String defaultSubDir = getDefaultProperty("fckeditor.subdir.media.file");
-	if (Utils.isEmpty(type))
-	    return defaultSubDir;
-	String subDir = getDefaultProperty("fckeditor.subdir.media.".concat(type.toLowerCase()));
+	private static final Logger logger = LoggerFactory.getLogger(ConfigurationHandler.class);
+
+	private static Properties defaultProperties = new Properties();
+	private static String baseDir;
+	private static IBaseDirProvider baseDirProvider = null;
+	private static String fckEditorDir;
+	private static String fckEditorHeight;
+	private static String fckEditorWidth;
+	private static String fckEditorToolbarSet;
+	private static boolean forceSingleExtension;
+
+	static {
+		// load defaults
+		try {
+			defaultProperties.load(new BufferedInputStream(ConfigurationHandler.class
+			    .getResourceAsStream("default.properties")));
+		} catch (IOException e) {
+			logger.error("Error while loading the default properties", e);
+			throw new RuntimeException("Can't load default properties", e);
+		}
+		baseDir = defaultProperties.getProperty("fckeditor.basedir");
+		fckEditorDir = defaultProperties.getProperty("fckeditor.dir");
+		fckEditorWidth = defaultProperties.getProperty("fckeditor.width");
+		fckEditorHeight = defaultProperties.getProperty("fckeditor.height");
+		fckEditorToolbarSet = defaultProperties.getProperty("fckeditor.toolbarset");
+		forceSingleExtension = Boolean.valueOf(defaultProperties.getProperty("forcesingleextension"));
+
+		logger.info("Default properties loaded and initialized successfully");
+	}
+
 	
-	return (Utils.isEmpty(subDir)) ? defaultSubDir : subDir;
-    }
+	/**
+	 * Getter for the base dir (using for user files).
+	 * 
+	 * @return If the {@link IBaseDirProvider} is set, then it's dir getter is called, or base dir.
+	 */
+	public static String getBaseDir() {
+		return (baseDirProvider != null) ? baseDirProvider.getDir() : baseDir;
+	}
+
+	/**
+	 * Setter for the base dir (using for user files).
+	 * 
+	 * @param baseDir
+	 *          relative to the context root (no leading or ending /).
+	 */
+	public static void setBaseDir(final String baseDir) {
+		ConfigurationHandler.baseDir = baseDir;
+	}
+
+	/**
+	 * Getter for the {@link IBaseDirProvider}.
+	 * 
+	 * @param baseDirProvider
+	 */
+	public static void setBaseDirProvider(final IBaseDirProvider baseDirProvider) {
+		ConfigurationHandler.baseDirProvider = baseDirProvider;
+	}
+
+	/**
+	 * Getter for the dir of the fckeditor.
+	 * 
+	 * @return Dir of the fckeditor relative to the context root.
+	 */
+	public static String getFckEditorDir() {
+		return fckEditorDir;
+	}
+
+	/**
+	 * Setter for the dir of the fckeditor.
+	 * 
+	 * @param fckEditorDir
+	 *          relative to the context root (no leading or ending /).
+	 */
+	public static void setFckEditorDir(final String fckEditorDir) {
+		ConfigurationHandler.fckEditorDir = fckEditorDir;
+	}
+
+	/**
+	 * Getter for the default height of the fckeditor.
+	 * 
+	 * @return Default height of the fckeditor.
+	 */
+	public static String getFckEditorHeight() {
+		return fckEditorHeight;
+	}
+
+	/**
+	 * Setter for the default height of the fckeditor.
+	 * 
+	 * @param fckEditorHeight
+	 *          the default height of the fckeditor.
+	 */
+	public static void setFckEditorHeight(final String fckEditorHeight) {
+		ConfigurationHandler.fckEditorHeight = fckEditorHeight;
+	}
+
+	/**
+	 * Getter for the default width of the fckeditor.
+	 * 
+	 * @return Default width of the fckeditor.
+	 */
+	public static String getFckEditorWidth() {
+		return fckEditorWidth;
+	}
+
+	/**
+	 * Setter for the default width of the fckeditor.
+	 * 
+	 * @param fckEditorWidth
+	 *          the default width of the fckeditor.
+	 */
+	public static void setFckEditorWidth(final String fckEditorWidth) {
+		ConfigurationHandler.fckEditorWidth = fckEditorWidth;
+	}
+
+	/**
+	 * Getter of the name of the default toolbarset of the fckeditor.
+	 * 
+	 * @return Name of the default toolbar set.
+	 */
+	public static String getFckEditorToolbarSet() {
+		return fckEditorToolbarSet;
+	}
+
+	/**
+	 * Getter of the name of the default toolbarset of the fckeditor.
+	 * 
+	 * @param fckEditorToolbarSet
+	 *          the name of the toolbarset.
+	 */
+	public static void setFckEditorToolbarSet(final String fckEditorToolbarSet) {
+		ConfigurationHandler.fckEditorToolbarSet = fckEditorToolbarSet;
+	}
+	
+	/**
+	 * Getter for the default handling of single extensions.
+	 * 
+   * @return the forceSingleExtension
+   */
+  public static boolean isForceSingleExtension() {
+  	return forceSingleExtension;
+  }
+
+	/**
+	 * Setter for the default handling of single extensions.
+	 *
+   * @param forceSingleExtension the forceSingleExtension to set
+   */
+  public static void setForceSingleExtension(boolean forceSingleExtension) {
+  	ConfigurationHandler.forceSingleExtension = forceSingleExtension;
+  }
+
+  /**
+   * Just a wrapper to {@link #setForceSingleExtension(boolean)}.
+   * 
+   * @param forceSingleExtension
+   */
+  public static void setForceSingleExtension(final String forceSingleExtension) {
+  	ConfigurationHandler.forceSingleExtension = Boolean.parseBoolean(forceSingleExtension);
+  }
+  
+	/**
+	 * Getter for a default property with the name 'key'.
+	 * 
+	 * @param key
+	 * @return The required property or null, if doesn't exists.
+	 */
+	public static String getDefaultProperty(final String key) {
+		return defaultProperties.getProperty(key);
+	}
+
+	/**
+	 * Getter for the dafault properties.
+	 * 
+	 * @return Default properties.
+	 */
+	public static Properties getDefaultProperties() {
+		return defaultProperties;
+	}
+
+	/**
+	 * Getter for the sub dir name of a media type.
+	 * 
+	 * @param type
+	 * @return The sub dir name of the requested type, or the default one ('file') if 'type' is unknown or empty.
+	 */
+	public static String getSubDirForType(final String type) {
+		String defaultSubDir = getDefaultProperty("fckeditor.subdir.media.file");
+		if (Utils.isEmpty(type))
+			return defaultSubDir;
+		String subDir = getDefaultProperty("fckeditor.subdir.media.".concat(type.toLowerCase()));
+
+		return (Utils.isEmpty(subDir)) ? defaultSubDir : subDir;
+	}
 }
Index: /FCKeditor.Java/branches/2.4/src/main/java/net/fckeditor/connector/ConnectorServlet.java
===================================================================
--- /FCKeditor.Java/branches/2.4/src/main/java/net/fckeditor/connector/ConnectorServlet.java	(revision 1416)
+++ /FCKeditor.Java/branches/2.4/src/main/java/net/fckeditor/connector/ConnectorServlet.java	(revision 1417)
@@ -82,6 +82,5 @@
 	private static final long serialVersionUID = -5742008970929377161L;
 	private static final Logger logger = LoggerFactory
-			.getLogger(ConnectorServlet.class);
-	private static boolean forceSingleExtension;
+			.getLogger(ConnectorServlet.class); 
 
 	/**
@@ -91,6 +90,12 @@
 	 */
 	public void init() throws ServletException {
+		if (getInitParameter("ForceSingleExtension") != null)
+			ConfigurationHandler.setForceSingleExtension(getInitParameter("ForceSingleExtension"));
+			
 		if (getInitParameter("baseDir") != null)
 			ConfigurationHandler.setBaseDir(getInitParameter("baseDir"));
+		
+		// TODO add init-params for each file type allowed/discard !!!
+		
 		String realBaseDir = getServletContext().getRealPath(
 				ConfigurationHandler.getBaseDir());
@@ -99,6 +104,4 @@
 			baseFile.mkdirs();
 		}
-		
-		forceSingleExtension = new Boolean(getInitParameter("ForceSingleExtension"));
 
 		logger.info("*** Connector Servlet initialized successfull!");
@@ -280,5 +283,5 @@
 					else {
 
-						if (forceSingleExtension) {
+						if (ConfigurationHandler.isForceSingleExtension()) {
 							filename = forceSingleExtension(filename);
 							baseName = FilenameUtils.removeExtension(filename);
@@ -329,7 +332,7 @@
 				.listFiles((FileFilter) DirectoryFileFilter.DIRECTORY);
 		for (File file : fileList) {
-			Element myEl = doc.createElement("Folder");
-			myEl.setAttribute("name", file.getName());
-			folders.appendChild(myEl);
+			Element folderElement = doc.createElement("Folder");
+			folderElement.setAttribute("name", file.getName());
+			folders.appendChild(folderElement);
 		}
 	}
@@ -341,8 +344,9 @@
 
 		for (File file : fileList) {
-			Element myEl = doc.createElement("File");
-			myEl.setAttribute("name", file.getName());
-			myEl.setAttribute("size", String.valueOf(file.length() / 1024));
-			files.appendChild(myEl);
+			Element fileElement = doc.createElement("File");
+			// TODO Check file extension with the ExtensionsHandler !!!
+			fileElement.setAttribute("name", file.getName());
+			fileElement.setAttribute("size", String.valueOf(file.length() / 1024));
+			files.appendChild(fileElement);
 		}
 	}
Index: /FCKeditor.Java/branches/2.4/src/main/resources/net/fckeditor/default.properties
===================================================================
--- /FCKeditor.Java/branches/2.4/src/main/resources/net/fckeditor/default.properties	(revision 1416)
+++ /FCKeditor.Java/branches/2.4/src/main/resources/net/fckeditor/default.properties	(revision 1417)
@@ -2,5 +2,5 @@
 ##
 ## @version $Id: default.properties 1184 2008-01-03 10:39:36Z th-schwarz $ 
-## @author <a href="mailto:th-schwarz@users.sourceforge.net">Thilo Schwarz</a>
+
 
 # default width of the editor
@@ -34,2 +34,5 @@
 fckeditor.media.extensions.allowed=
 fckeditor.media.extensions.denied=
+
+# Due to security issues with Apache modules, it is recommended to leave this setting enabled.
+fckeditor.forcesingleextension=true
