Index: /FCKeditor.Java/branches/2.4/src/main/java/net/fckeditor/ExtensionsHandler.java
===================================================================
--- /FCKeditor.Java/branches/2.4/src/main/java/net/fckeditor/ExtensionsHandler.java	(revision 1431)
+++ /FCKeditor.Java/branches/2.4/src/main/java/net/fckeditor/ExtensionsHandler.java	(revision 1432)
@@ -28,6 +28,10 @@
 
 /**
- * Static object which manages the allowed and denied extensions for each file type. The different extensions are preset
- * by the defaults defined in default.properties.
+ * Static object which manages the allowed and denied extensions for each file type. The
+ * extensions are preset by the defaults defined in default.properties.
+ * 
+ * Hint: It's recomment use either allowed or denied extensions for one file type.
+ * Never use both at the same time! That's why denied extensions of a file type will be 
+ * deleted, if you set the allowed one and vice versa.
  * 
  * @version $Id$
@@ -35,93 +39,97 @@
 public class ExtensionsHandler {
 
-    private static Map<String, Set<String>> extensionsAllowed = new HashMap<String, Set<String>>();
-    private static Map<String, Set<String>> extensionsDenied = new HashMap<String, Set<String>>();
+	private static Map<String, Set<String>> extensionsAllowed = new HashMap<String, Set<String>>();
+	private static Map<String, Set<String>> extensionsDenied = new HashMap<String, Set<String>>();
 
-    static {
-	// load defaults 
-	extensionsAllowed.put(Constants.FILE_TYPE_FILE, 
-		Utils.getSet(ConfigurationHandler.getDefaultProperty("fckeditor.file.extensions.allowed")));
-	extensionsDenied.put(Constants.FILE_TYPE_FILE, 
-		Utils.getSet(ConfigurationHandler.getDefaultProperty("fckeditor.file.extensions.denied")));
-	extensionsAllowed.put(Constants.FILE_TYPE_MEDIA, 
-		Utils.getSet(ConfigurationHandler.getDefaultProperty("fckeditor.media.extensions.allowed")));
-	extensionsDenied.put(Constants.FILE_TYPE_MEDIA, 
-		Utils.getSet(ConfigurationHandler.getDefaultProperty("fckeditor.media.extensions.denied")));
-	extensionsAllowed.put(Constants.FILE_TYPE_IMAGE, 
-		Utils.getSet(ConfigurationHandler.getDefaultProperty("fckeditor.image.extensions.allowed")));
-	extensionsDenied.put(Constants.FILE_TYPE_IMAGE, 
-		Utils.getSet(ConfigurationHandler.getDefaultProperty("fckeditor.image.extensions.denied")));
-	extensionsAllowed.put(Constants.FILE_TYPE_FLASH, 
-		Utils.getSet(ConfigurationHandler.getDefaultProperty("fckeditor.flash.extensions.allowed")));
-	extensionsDenied.put(Constants.FILE_TYPE_FLASH, 
-		Utils.getSet(ConfigurationHandler.getDefaultProperty("fckeditor.flash.extensions.denied")));
-    }
+	static {
+		// load defaults
+		extensionsAllowed.put(Constants.FILE_TYPE_FILE, Utils.getSet(ConfigurationHandler
+		    .getDefaultProperty("fckeditor.file.extensions.allowed")));
+		extensionsDenied.put(Constants.FILE_TYPE_FILE, Utils.getSet(ConfigurationHandler
+		    .getDefaultProperty("fckeditor.file.extensions.denied")));
+		extensionsAllowed.put(Constants.FILE_TYPE_MEDIA, Utils.getSet(ConfigurationHandler
+		    .getDefaultProperty("fckeditor.media.extensions.allowed")));
+		extensionsDenied.put(Constants.FILE_TYPE_MEDIA, Utils.getSet(ConfigurationHandler
+		    .getDefaultProperty("fckeditor.media.extensions.denied")));
+		extensionsAllowed.put(Constants.FILE_TYPE_IMAGE, Utils.getSet(ConfigurationHandler
+		    .getDefaultProperty("fckeditor.image.extensions.allowed")));
+		extensionsDenied.put(Constants.FILE_TYPE_IMAGE, Utils.getSet(ConfigurationHandler
+		    .getDefaultProperty("fckeditor.image.extensions.denied")));
+		extensionsAllowed.put(Constants.FILE_TYPE_FLASH, Utils.getSet(ConfigurationHandler
+		    .getDefaultProperty("fckeditor.flash.extensions.allowed")));
+		extensionsDenied.put(Constants.FILE_TYPE_FLASH, Utils.getSet(ConfigurationHandler
+		    .getDefaultProperty("fckeditor.flash.extensions.denied")));
+	}
 
-    /**
-     * Getter for the allowed extensions of a file type.
-     * 
-     * @param type
-     *                The file type.
-     * @return Set of allowed extensions or an empty set.
-     */
-    public static Set<String> getExtensionsAllowed(final String type) {
-	return ExtensionsHandler.extensionsAllowed.get(type);
-    }
+	/**
+	 * Getter for the allowed extensions of a file type.
+	 * 
+	 * @param type
+	 *          The file type.
+	 * @return Set of allowed extensions or an empty set.
+	 */
+	public static Set<String> getExtensionsAllowed(final String type) {
+		return extensionsAllowed.get(type);
+	}
 
-    /**
-     * Setter for the allowed extensions of a file type.<br>
-     * If 'extensionsList' is null, allowed extensions kept untouched.
-     * 
-     * @param type
-     *                The file type.
-     * @param extensionsList
-     *                Required format: <code>ext1&#124;ext2&#124;ext3</code>
-     */
-    public static void setExtensionsAllowed(final String type, final String extensionsList) {
-	if (extensionsList != null)
-	    ExtensionsHandler.extensionsAllowed.put(type, Utils.getSet(extensionsList));
-    }
+	/**
+	 * Setter for the allowed extensions of a file type. The denied extensions will be cleared.<br>
+	 * If 'extensionsList' is null, allowed extensions kept untouched.
+	 * 
+	 * @param type
+	 *          The file type.
+	 * @param extensionsList
+	 *          Required format: <code>ext1&#124;ext2&#124;ext3</code>
+	 */
+	public static void setExtensionsAllowed(final String type, final String extensionsList) {
+		if (extensionsList != null) {
+			extensionsAllowed.put(type, Utils.getSet(extensionsList));
+			extensionsDenied.get(type).clear();
+		}
+	}
 
-    /**
-     * Getter for the denied extensions of a file type.
-     * 
-     * @param type
-     *                The file type.
-     * @return Set of denied extensions or an empty set.
-     */
-    public static Set<String> getExtensionsDenied(final String type) {
-	return ExtensionsHandler.extensionsDenied.get(type);
-    }
+	/**
+	 * Getter for the denied extensions of a file type.
+	 * 
+	 * @param type
+	 *          The file type.
+	 * @return Set of denied extensions or an empty set.
+	 */
+	public static Set<String> getExtensionsDenied(final String type) {
+		return extensionsDenied.get(type);
+	}
 
-    /**
-     * Setter for the denied extensions of a file type.<br>
-     * If 'extensionsList' is null, denied extensions kept untouched.
-     * 
-     * @param type
-     *                The file type.
-     * @param extensionsList
-     *                Required format: <code>ext1&#124;ext2&#124;ext3</code>
-     */
-    public static void setExtensionsDenied(final String type, final String extensionsList) {
-	if (extensionsList != null)
-	    ExtensionsHandler.extensionsDenied.put(type, Utils.getSet(extensionsList));
-    }
+	/**
+	 * Setter for the denied extensions of a file type. The allowed extensions will be cleared.<br>
+	 * If 'extensionsList' is null, denied extensions kept untouched.
+	 * 
+	 * @param type
+	 *          The file type.
+	 * @param extensionsList
+	 *          Required format: <code>ext1&#124;ext2&#124;ext3</code>
+	 */
+	public static void setExtensionsDenied(final String type, final String extensionsList) {
+		if (extensionsList != null) {
+			extensionsDenied.put(type, Utils.getSet(extensionsList));
+			extensionsAllowed.get(type).clear();
+		}
+	}
 
-    /**
-     * Checks, if an extension is allowed for a file type.
-     * 
-     * @param type
-     * @param extension
-     * @return True, false.
-     */
-    public static boolean isAllowed(final String type, final String extension) {
-	String ext = extension.toLowerCase();
-	Set<String> allowed = extensionsAllowed.get(type);
-	Set<String> denied = extensionsDenied.get(type);
-	if (allowed.isEmpty())
-	    return (denied.contains(ext)) ? false : true;
-	if (denied.isEmpty())
-	    return (allowed.contains(ext)) ? true : false;
-	return false;
-    }
+	/**
+	 * Checks, if an extension is allowed for a file type.
+	 * 
+	 * @param type
+	 * @param extension
+	 * @return True, false.
+	 */
+	public static boolean isAllowed(final String type, final String extension) {
+		String ext = extension.toLowerCase();
+		Set<String> allowed = extensionsAllowed.get(type);
+		Set<String> denied = extensionsDenied.get(type);
+		if (allowed.isEmpty())
+			return (denied.contains(ext)) ? false : true;
+		if (denied.isEmpty())
+			return (allowed.contains(ext)) ? true : false;
+		return false;
+	}
 }
