Index: /FCKeditor.Java/trunk/java-core/src/main/java/net/fckeditor/handlers/ResourceType.java
===================================================================
--- /FCKeditor.Java/trunk/java-core/src/main/java/net/fckeditor/handlers/ResourceType.java	(revision 2737)
+++ /FCKeditor.Java/trunk/java-core/src/main/java/net/fckeditor/handlers/ResourceType.java	(revision 2738)
@@ -29,6 +29,7 @@
 
 /**
- * TODO improve doc Common resource type holder without any implementation
- * (connector) specific stuff.
+ * This class maps to all file browser resource types and their allowed/denied
+ * extensions. The design is restricted to the static types only, you cannot
+ * create your own types. External access to all fields is read-only.
  * 
  * @version $Id$
@@ -36,11 +37,18 @@
 public class ResourceType {
 
+	/** The name of the resource type */
 	private String name;
+	/** The absolute path of the resource type */
 	private String path;
+	/** The allowed extensions */
 	private Set<String> allowedEextensions;
+	/** The denied extensions */
 	private Set<String> deniedExtensions;
 
+	/** Map holding a String to ResourceType reference */
 	private static Map<String, ResourceType> types = new HashMap<String, ResourceType>(
 			4);
+
+	/** Resource type <code>File</code> */
 	public static final ResourceType FILE = new ResourceType("file",
 			PropertiesLoader.getFileResourceTypePath(), Utils
@@ -49,4 +57,5 @@
 					.getSet(PropertiesLoader
 							.getFileResourceTypeDeniedExtensions()));
+	/** Resource type <code>Flash</code> */
 	public static final ResourceType FLASH = new ResourceType("flash",
 			PropertiesLoader.getFlashResourceTypePath(), Utils
@@ -55,4 +64,5 @@
 					.getSet(PropertiesLoader
 							.getFlashResourceTypeDeniedExtensions()));
+	/** Resource type <code>Image</code> */
 	public static final ResourceType IMAGE = new ResourceType("image",
 			PropertiesLoader.getImageResourceTypePath(), Utils
@@ -61,4 +71,5 @@
 					.getSet(PropertiesLoader
 							.getImageResourceTypeDeniedExtensions()));
+	/** Resource type <code>Media</code> */
 	public static final ResourceType MEDIA = new ResourceType("media",
 			PropertiesLoader.getMediaResourceTypePath(), Utils
@@ -75,4 +86,17 @@
 	}
 
+	/**
+	 * This constructor has been made intentionally made private to provide
+	 * pre-defined types only.
+	 * 
+	 * @param name
+	 * @param path
+	 * @param allowedEextensions
+	 * @param deniedExtensions
+	 * @throws IllegalArgumentException
+	 *             if both sets are empty
+	 * @throws IllegalArgumentException
+	 *             if both sets contain extensions
+	 */
 	private ResourceType(final String name, final String path,
 			final Set<String> allowedEextensions,
@@ -94,4 +118,5 @@
 
 	/**
+	 * Returns the name of the resource type.
 	 * 
 	 * @return the name
@@ -102,4 +127,8 @@
 
 	/**
+	 * Returns the absolute path of the resource type. This path will later be
+	 * resolved against the
+	 * {@link RequestCycleHandler#getUserFilesPath(javax.servlet.http.HttpServletRequest)
+	 * UserFilesPath}.
 	 * 
 	 * @return the path
@@ -110,5 +139,5 @@
 
 	/**
-	 * This will give you a read-only reference to the allowed extensions set.
+	 * Returns a read-only reference to the allowed extensions set.
 	 * 
 	 * @return the allowedEextensions
@@ -119,5 +148,5 @@
 
 	/**
-	 * This will give you a read-only reference to the denied extensions set.
+	 * Returns a read-only reference to the denied extensions set.
 	 * 
 	 * @return the deniedExtensions
@@ -128,9 +157,9 @@
 
 	/**
-	 * Getter for a {@link ResourceType} for a specified string. <br>
-	 * The comparison isn't case sensitive!
-	 * 
-	 * @param name
-	 *            A resource type to retrieve.
+	 * Returns the {@link ResourceType} for a specified string. <br />
+	 * <em>The retrieval is case-insensitive!</em>
+	 * 
+	 * @param name
+	 *            Resource type name.
 	 * @return A {@link ResourceType} object holding the value represented by
 	 *         the string argument.
@@ -140,20 +169,21 @@
 	public static ResourceType valueOf(final String name) {
 		if (Utils.isEmpty(name))
-			throw new IllegalArgumentException();
+			throw new IllegalArgumentException("Parameter name is empty");
 
 		ResourceType rt = types.get(name.toLowerCase());
 		if (rt == null)
-			throw new IllegalArgumentException();
+			throw new IllegalArgumentException(
+					"No suitable resource type found");
 		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>.
+	 * Determines if a specified string represents a valid resource type.<br />
+	 * <em>The retrieval is case-insensitive!</em>
+	 * 
+	 * @param name
+	 *            Resource type name.
+	 * @return <code>true</code> if the string represents a valid resource type
+	 *         else <code>false</code>.
 	 */
 	public static boolean isValidType(final String name) {
@@ -163,10 +193,10 @@
 
 	/**
-	 * 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.
+	 * This method wraps {@link #valueOf(String)}. It returns <code>null</code>
+	 * instead of throwing an IllegalArgumentException.<br />
+	 * <em>The retrieval is case-insensitive!</em>
+	 * 
+	 * @param name
+	 *            Resource type string.
 	 * @return A {@link ResourceType} object holding the value represented by
 	 *         the string argument, or <code>null</code>.
@@ -181,11 +211,12 @@
 
 	/**
-	 * 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
+	 * This method wraps {@link #getResourceType(String)}. It returns
+	 * {@link #FILE} instead of returning <code>null</code>.<br />
+	 * <em>The retrieval is case-insensitive!</em>
+	 * 
+	 * @param name
+	 *            Resource type string.
+	 * @return A {@link ResourceType} object holding the value represented by
+	 *         the string argument.
 	 */
 	public static ResourceType getDefaultResourceType(final String name) {
@@ -197,12 +228,12 @@
 
 	/**
-	 * Checks if an extension is allowed/denied for a file type based on the
-	 * allowed and denied sets.
+	 * Determines if an extension passes/suits the allowed or denied set.<br />
+	 * <em>Empty extensions will always fail!</em>
+	 * 
 	 * 
 	 * @param extension
-	 *            The extension you want to check.
-	 * @return <code>true</code> is extension is allowed else <code>false</code>
-	 *         . <em>Attention</em>: <code>false</code> is always returned if
-	 *         'extension' is empty.
+	 *            Extension string.
+	 * @return <code>true</code> if the extension passes, else
+	 *         <code>false</code>.
 	 */
 	public boolean isAllowedExtension(final String extension) {
@@ -218,9 +249,10 @@
 
 	/**
-	 * This is a stupid negating wrapper around
-	 * {@link #isAllowedExtension(String)}.
+	 * This method wraps {@link #isAllowedExtension(String)}. It simply negates
+	 * the return value.
 	 * 
 	 * @param extension
-	 * @return <code>true</code> if extension is not allowed else
+	 *            Extension string.
+	 * @return <code>true</code> if extension is not fails, else
 	 *         <code>false</code>.
 	 */
@@ -229,8 +261,6 @@
 	}
 
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see java.lang.Object#equals(java.lang.Object)
+	/**
+	 * Compares <code>this</code> with the passed object against the name field.
 	 */
 	@Override
@@ -246,8 +276,6 @@
 	}
 
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see java.lang.Object#hashCode()
+	/**
+	 * Computer hash code based on the name field.
 	 */
 	@Override
