Index: /FCKeditor.Java/branches/2.4/java-core/pom.xml
===================================================================
--- /FCKeditor.Java/branches/2.4/java-core/pom.xml	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-core/pom.xml	(revision 1893)
@@ -0,0 +1,141 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+                      http://maven.apache.org/xsd/maven-4.0.0.xsd"
+>
+	<modelVersion>4.0.0</modelVersion>
+	<artifactId>java-core</artifactId>
+	<packaging>jar</packaging>
+	<dependencies>
+		<dependency>
+			<groupId>javax.servlet</groupId>
+			<artifactId>servlet-api</artifactId>
+			<version>2.4</version>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>javax.servlet.jsp</groupId>
+			<artifactId>jsp-api</artifactId>
+			<version>2.0</version>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>4.4</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.slf4j</groupId>
+			<artifactId>slf4j-nop</artifactId>
+			<version>1.5.0</version>
+			<scope>test</scope>
+		</dependency>
+	</dependencies>
+	<parent>
+		<groupId>net.fckeditor</groupId>
+		<artifactId>fckeditor-java</artifactId>
+		<version>2.4-SNAPSHOT</version>
+	</parent>
+
+	<build>
+		<plugins>
+			<plugin>
+				<artifactId>maven-antrun-plugin</artifactId>
+				<executions>
+					<execution>
+						<id>rewrite-tagreference-links</id>
+						<phase>site</phase>
+						<goals>
+							<goal>run</goal>
+						</goals>
+						<configuration>
+							<tasks>
+								<property name="ant.regexp.regexpimpl"
+									value="org.apache.tools.ant.util.regexp.Jdk14RegexpRegexp"
+								/>
+
+								<!--<echo
+									message="Rewriting links in tag reference"
+									/>-->
+								<replaceregexp byline="true" flags="m"
+									file="target/site/tagreference.html"
+								>
+									<regexp
+										pattern="&amp;lt;a href=&amp;quot;(\p{Graph}+)&amp;quot;\s*&amp;gt;(\p{Graph}+)&amp;lt;/a&amp;gt;"
+									/>
+									<substitution
+										expression="&lt;a href=&quot;\1&quot;&gt;\2&lt;/a&gt;"
+									/>
+								</replaceregexp>
+							</tasks>
+						</configuration>
+					</execution>
+				</executions>
+				<!--<dependencies>
+					<dependency>
+					<groupId>ant</groupId>
+					<artifactId>ant-nodeps</artifactId>
+					<version>1.6.5</version>
+					</dependency>
+					</dependencies>-->
+			</plugin>
+		</plugins>
+	</build>
+
+	<reporting>
+		<plugins>
+			<plugin>
+				<groupId>net.sourceforge.maven-taglib</groupId>
+				<artifactId>maven-taglib-plugin</artifactId>
+			</plugin>
+			<plugin>
+				<artifactId>maven-surefire-report-plugin</artifactId>
+			</plugin>
+			<plugin>
+				<artifactId>maven-jxr-plugin</artifactId>
+			</plugin>
+			<plugin>
+				<artifactId>maven-pmd-plugin</artifactId>
+				<configuration>
+					<targetJdk>1.5</targetJdk>
+				</configuration>
+			</plugin>
+			<plugin>
+				<groupId>org.codehaus.mojo</groupId>
+				<artifactId>cobertura-maven-plugin</artifactId>
+			</plugin>
+			<plugin>
+				<groupId>org.codehaus.mojo</groupId>
+				<artifactId>taglist-maven-plugin</artifactId>
+				<configuration>
+					<tags>
+						<tag>TODO</tag>
+						<tag>FIXME</tag>
+					</tags>
+				</configuration>
+			</plugin>
+			<plugin>
+				<artifactId>
+					maven-project-info-reports-plugin
+				</artifactId>
+				<reportSets>
+					<reportSet>
+						<reports>
+							<report>dependencies</report>
+							<report>summary</report>
+						</reports>
+					</reportSet>
+				</reportSets>
+			</plugin>
+		</plugins>
+	</reporting>
+
+	<name>FCKeditor.Java Integration Core</name>
+	<description>
+		This Java library enables the FCKeditor to be used in a
+		Servlet/J2EE environment. It provides JSP tags for creating a FCKeditor
+		instance and a Servlet handling server-side user files and folders.
+	</description>
+</project>
Index: /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/FCKeditor.java
===================================================================
--- /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/FCKeditor.java	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/FCKeditor.java	(revision 1893)
@@ -0,0 +1,275 @@
+/*
+ * 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;
+
+import javax.servlet.http.HttpServletRequest;
+
+import net.fckeditor.handlers.PropertiesLoader;
+import net.fckeditor.tool.Compatibility;
+import net.fckeditor.tool.Utils;
+import net.fckeditor.tool.XHtmlTagTool;
+
+/**
+ * FCKeditor control class.<br>
+ * 
+ * It creates the html code for the FCKeditor based on the following things:
+ * <ul>
+ * <li>browser's capabilities</li>
+ * <li>different properties settings managed by the {@link PropertiesLoader}</li>
+ * <li>settings from the 'caller', eg. jsp-pages</li>
+ * </ul>
+ * 
+ * @version $Id$
+ */
+public class FCKeditor {
+
+	private FCKeditorConfig config;
+	private String instanceName;
+	private String value;
+	private String basePath;
+	private HttpServletRequest request;
+
+	// defaults
+	private String toolbarSet = PropertiesLoader.getProperty("fckeditor.toolbarSet");
+	private String width = PropertiesLoader.getProperty("fckeditor.width");
+	private String height = PropertiesLoader.getProperty("fckeditor.height");
+	private String defaultBasePath = PropertiesLoader.getProperty("fckeditor.basePath");
+
+	/**
+	 * Main constructor.<br>
+	 * All important settings are done here and will be preset by there defaults taken from
+	 * {@link PropertiesLoader}.
+	 * 
+	 * @param request
+	 *            request object
+	 * @param instanceName
+	 *            unique name
+	 * @param width
+	 *            width
+	 * @param height
+	 *            height
+	 * @param toolbarSet
+	 *            toolbarSet name
+	 */
+	public FCKeditor(final HttpServletRequest request, final String instanceName,
+	        final String width, final String height, final String toolbarSet, final String value,
+	        final String basePath) {
+		this.request = request;
+		this.instanceName = instanceName;
+		if (Utils.isNotEmpty(width))
+			this.width = width;
+		if (Utils.isNotEmpty(height))
+			this.height = height;
+		if (Utils.isNotEmpty(toolbarSet))
+			this.toolbarSet = toolbarSet;
+		if (Utils.isNotEmpty(value))
+			this.value = value;
+		if (Utils.isNotEmpty(basePath))
+			this.basePath = request.getContextPath().concat(basePath);
+		else
+			this.basePath = request.getContextPath().concat(defaultBasePath);
+
+		config = new FCKeditorConfig();
+	}
+
+	/**
+	 * Just a wrapper to {@link FCKeditor}.
+	 * 
+	 * @param request
+	 *            request object
+	 * @param instanceName
+	 *            unique name
+	 */
+
+	public FCKeditor(final HttpServletRequest request, final String instanceName) {
+		this(request, instanceName, null, null, null, null, null);
+	}
+
+	/**
+	 * Set the unique name of the editor
+	 * 
+	 * @param value
+	 *            name
+	 */
+	public void setInstanceName(final String value) {
+		instanceName = value;
+	}
+
+	/**
+	 * Set the initial value to be edited.<br>
+	 * In HTML code
+	 * 
+	 * @param value
+	 *            value
+	 */
+	public void setValue(final String value) {
+		this.value = value;
+	}
+
+	/**
+	 * Set the dir where the FCKeditor files reside on the server.<br>
+	 * <b>Remarks</b>:<br>
+	 * Avoid using relative paths. It is preferable to set the base path starting from the root (/).<br>
+	 * Always finish the path with a slash (/).
+	 * 
+	 * @param value
+	 *            path
+	 */
+	public void setBasePath(final String value) {
+		basePath = value;
+	}
+
+	/**
+	 * Set the name of the toolbar to display
+	 * 
+	 * @param value
+	 *            toolbar name
+	 */
+	public void setToolbarSet(final String value) {
+		toolbarSet = value;
+	}
+
+	/**
+	 * Set the width of the textarea
+	 * 
+	 * @param value
+	 *            width
+	 */
+	public void setWidth(final String value) {
+		width = value;
+	}
+
+	/**
+	 * Set the height of the textarea
+	 * 
+	 * @param value
+	 *            height
+	 */
+	public void setHeight(final String value) {
+		height = value;
+	}
+
+	/**
+	 * Get the advanced configuation set.<br>
+	 * Adding element to this collection you can override the settings specified in the config.js
+	 * file.
+	 * 
+	 * @return configuration collection
+	 */
+	public FCKeditorConfig getConfig() {
+		return config;
+	}
+
+	/**
+	 * Set the advanced configuation set.
+	 * 
+	 * @param value
+	 *            configuration collection
+	 */
+	public void setConfig(FCKeditorConfig value) {
+		config = value;
+	}
+
+	private String escapeXml(String txt) {
+		if (Utils.isEmpty(txt))
+			return txt;
+		txt = txt.replaceAll("&", "&#38;");
+		txt = txt.replaceAll("<", "&#60;");
+		txt = txt.replaceAll(">", "&#62;");
+		txt = txt.replaceAll("\"", "&#34;");
+		txt = txt.replaceAll("'", "&#39;");
+		return txt;
+	}
+
+	/**
+	 * Minimum implementation, see ticket #27 for detailed information.
+	 */
+	public String create() {
+		return createHtml();
+	}
+
+	@Override
+	public String toString() {
+		return createHtml();
+	}
+
+	/**
+	 * Generate the HTML Code for the editor. <br>
+	 * Evalute the browser capabilities and generate the editor if compatible, or a simple textarea
+	 * otherwise.
+	 * 
+	 * @return html code
+	 */
+	public String createHtml() {
+		StringBuffer strEditor = new StringBuffer();
+
+		strEditor.append("<div>");
+		String encodedValue = escapeXml(value.replaceAll("((\r?\n)+|\t*)", ""));
+
+		if (Compatibility.check(request.getHeader("user-agent"))) {
+			strEditor.append(createInputForVariable(instanceName, instanceName, encodedValue));
+
+			// create config html
+			String configStr = config.getUrlParams();
+			if (Utils.isNotEmpty(configStr))
+				// configStr = configStr.substring(1);
+				strEditor.append(createInputForVariable(null, instanceName.concat("___Config"),
+				        configStr));
+
+			// create IFrame
+			String sLink = basePath.concat("/editor/fckeditor.html?InstanceName=").concat(
+			        instanceName);
+			if (Utils.isNotEmpty(toolbarSet))
+				sLink += "&Toolbar=".concat(toolbarSet);
+			XHtmlTagTool iframeTag = new XHtmlTagTool("iframe", XHtmlTagTool.SPACE);
+			iframeTag.addAttribute("id", instanceName.concat("___Frame"));
+			iframeTag.addAttribute("src", sLink);
+			iframeTag.addAttribute("width", width);
+			iframeTag.addAttribute("height", height);
+			iframeTag.addAttribute("frameborder", "no");
+			iframeTag.addAttribute("scrolling", "no");
+			strEditor.append(iframeTag);
+
+		} else {
+			XHtmlTagTool textareaTag = new XHtmlTagTool("textarea", encodedValue);
+			textareaTag.addAttribute("name", instanceName);
+			textareaTag.addAttribute("rows", "4");
+			textareaTag.addAttribute("cols", "40");
+			textareaTag.addAttribute("wrap", "virtual");
+			textareaTag.addAttribute("style", "width: ".concat(width).concat("; height: ").concat(
+			        height));
+		}
+		strEditor.append("</div>");
+		return strEditor.toString();
+	}
+
+	private String createInputForVariable(final String name, final String id, final String value) {
+		XHtmlTagTool tag = new XHtmlTagTool("input");
+		if (Utils.isNotEmpty(id))
+			tag.addAttribute("id", id);
+		if (Utils.isNotEmpty(name))
+			tag.addAttribute("name", name);
+		tag.addAttribute("value", value);
+		tag.addAttribute("type", "hidden");
+		return tag.toString();
+	}
+}
Index: /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/FCKeditorConfig.java
===================================================================
--- /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/FCKeditorConfig.java	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/FCKeditorConfig.java	(revision 1893)
@@ -0,0 +1,79 @@
+/*
+ * 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;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.HashMap;
+import java.util.Map;
+
+import net.fckeditor.tool.Utils;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Contains the configuration settings for the FCKEditor.<br>
+ * Adding element to this collection you can override the settings specified in
+ * the config.js file.
+ * 
+ * @version $Id: FCKeditorConfig.java 1444 2008-01-28 16:53:01Z mosipov $
+ */
+public class FCKeditorConfig extends HashMap<String, String> {
+
+	private static final long serialVersionUID = -4831190504944866644L;
+	private final Logger logger = LoggerFactory.getLogger(FCKeditorConfig.class);
+
+	/**
+	 * Initialize the configuration collection
+	 */
+	public FCKeditorConfig() {
+		super();
+	}
+
+	/**
+	 * Generate the url parameter sequence used to pass this configuration to
+	 * the editor.
+	 * 
+	 * @return html endocode sequence of configuration parameters
+	 */
+	public String getUrlParams() {
+		StringBuffer osParams = new StringBuffer();
+		try {
+			for (Map.Entry<String, String> entry : this.entrySet()) {
+				if (Utils.isNotEmpty(entry.getValue())) {
+					osParams.append("&");
+					osParams.append(URLEncoder.encode(entry.getKey(),"UTF-8"));
+					osParams.append("=");
+					osParams.append(URLEncoder.encode(entry.getValue(),"UTF-8"));
+				}
+			}
+			
+		} catch (UnsupportedEncodingException e) {
+			logger.error("Configuration parameters could not be encoded", e);
+		}
+		
+		if (osParams.length() > 0)
+			osParams.deleteCharAt(0);
+		return osParams.toString();
+	}
+}
Index: /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/SessionData.java
===================================================================
--- /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/SessionData.java	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/SessionData.java	(revision 1893)
@@ -0,0 +1,83 @@
+/*
+ * 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;
+
+import javax.servlet.http.HttpServletRequest;
+
+import net.fckeditor.handlers.ConnectorHandler;
+
+/**
+ * Interface to provide session or request based functionality to FCKeditor.Java. Currently, the
+ * implemeted class has to implement the following:
+ * <ul>
+ * <li>{@link #isEnabledForFileBrowsing(HttpServletRequest)}: Enables the user to browse/select
+ * file.</li>
+ * <li>{@link #isEnabledForFileUpload(HttpServletRequest)}: Enables the user to upload files.</li>
+ * <li>{@link #getUserFilesPath(HttpServletRequest)}: It is used by
+ * {@link ConnectorHandler#getUserFilesPath(HttpServletRequest)} to build an user based 'BaseDir'.</li>
+ * </ul>
+ * {@link #isEnabledForFileBrowsing(HttpServletRequest)} and
+ * {@link #isEnabledForFileUpload(HttpServletRequest)} are authentification methods for different
+ * kinds of user actions.<br />
+ * <br />
+ * <b>Warning for commiters: </b>You have to awake that every change of this interface could break
+ * all classes which implemented this interface. Therefore you should change this interface for
+ * milestone releases only!
+ * 
+ * @version $Id$
+ */
+public interface SessionData {
+
+	/**
+	 * Authenticates/enables the current user for uploading file.<br>
+	 * If the implementation doesn't bother you, just return <code>true</code>.
+	 * 
+	 * @param request
+	 *            Servlet request from user
+	 * @return <code>true</code> if user can upload to the server else <code>false</code>
+	 */
+	public boolean isEnabledForFileUpload(final HttpServletRequest request);
+
+	/**
+	 * Authenticates/enables the current user for browsing files.<br>
+	 * If the implementation doesn't bother you, just return <code>true</code>.
+	 * 
+	 * @param request
+	 *            Servlet request from user
+	 * @return <code>true</code> if use can browse the server else <code>false</code>
+	 */
+	public boolean isEnabledForFileBrowsing(final HttpServletRequest request);
+
+	/**
+	 * Getter for the user dependent 'BaseDir'.<br>
+	 * <b>Important:</b>
+	 * <ul>
+	 * <li> If the implementation returns <code>null</code>, {@link ConnectorHandler} will used
+	 * the default one! That's useful, if the implementation doesn't bother you.</li>
+	 * <li>The returned directory string has to start with '/', but has to end without '/'.</li>
+	 * <li>The dir has to be within the context</li>
+	 * </ul>
+	 * 
+	 * @param request
+	 * @return <code>null</code> or the 'BaseDir' string for the current user.
+	 */
+	public String getUserFilesPath(final HttpServletRequest request);
+}
Index: /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/connector/ConnectorServlet.java
===================================================================
--- /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/connector/ConnectorServlet.java	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/connector/ConnectorServlet.java	(revision 1893)
@@ -0,0 +1,302 @@
+/*
+ * 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;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.List;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import net.fckeditor.handlers.CommandHandler;
+import net.fckeditor.handlers.ConnectorHandler;
+import net.fckeditor.handlers.ExtensionsHandler;
+import net.fckeditor.handlers.ResourceTypeHandler;
+import net.fckeditor.handlers.SessionDataHandler;
+import net.fckeditor.response.UploadResponse;
+import net.fckeditor.response.XmlResponse;
+import net.fckeditor.tool.Utils;
+import net.fckeditor.tool.UtilsFile;
+import net.fckeditor.tool.UtilsResponse;
+
+import org.apache.commons.fileupload.FileItem;
+import org.apache.commons.fileupload.FileItemFactory;
+import org.apache.commons.fileupload.disk.DiskFileItemFactory;
+import org.apache.commons.fileupload.servlet.ServletFileUpload;
+import org.apache.commons.io.FilenameUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Servlet to upload and browse files.<br>
+ * 
+ * This servlet accepts 4 commands used to retrieve and create files and folders from a server
+ * directory. The allowed commands are:
+ * <ul>
+ * <li>GetFolders: Retrieve the list of directory under the current folder
+ * <li>GetFoldersAndFiles: Retrive the list of files and directory under the current folder
+ * <li>CreateFolder: Create a new directory under the current folder
+ * <li>FileUpload: Send a new file to the server (must be sent with a POST)
+ * </ul>
+ * 
+ * @version $Id$
+ */
+public class ConnectorServlet extends HttpServlet {
+
+	private static final long serialVersionUID = -5742008970929377161L;
+	private static final Logger logger = LoggerFactory.getLogger(ConnectorServlet.class);
+
+	/**
+	 * Initialize the servlet.<br>
+	 * The default directory for user files will be constructed.
+	 */
+	public void init() throws ServletException, IllegalArgumentException {
+		// check, if 'baseDir' exists
+		String realDefaultUserFilesPath = getServletContext().getRealPath(
+		        ConnectorHandler.getDefaultUserFilesPath());
+
+		File defaultUserFilesDir = new File(realDefaultUserFilesPath);
+		UtilsFile.checkDirAndCreate(defaultUserFilesDir);
+
+		// FIXME wrong spelling
+		logger.info("ConnectorServlet successfull initialized!");
+	}
+
+	/**
+	 * Manage the Get requests (GetFolders, GetFoldersAndFiles, CreateFolder).<br>
+	 * 
+	 * The servlet accepts commands sent in the following format:<br>
+	 * connector?Command=CommandName&Type=ResourceType&CurrentFolder=FolderPath<br>
+	 * <br>
+	 * It executes the commands and then return the results to the client in XML format.
+	 * 
+	 */
+	public void doGet(HttpServletRequest request, HttpServletResponse response)
+	        throws ServletException, IOException {
+		logger.debug("Entering ConnectorServlet#doGet");
+
+		response.setCharacterEncoding("UTF-8");
+		response.setContentType("application/xml; charset=UTF-8");
+		response.setHeader("Cache-Control", "no-cache");
+		PrintWriter out = response.getWriter();
+
+		String commandStr = request.getParameter("Command");
+		String typeStr = request.getParameter("Type");
+		String currentFolderStr = request.getParameter("CurrentFolder");
+
+		logger.debug("Parameter Command: {}", commandStr);
+		logger.debug("Parameter Type: {}", typeStr);
+		logger.debug("Parameter CurrentFolder: {}", currentFolderStr);
+
+		XmlResponse xr;
+
+		if (!SessionDataHandler.isEnabledForFileBrowsing(request))
+			xr = new XmlResponse(XmlResponse.EN_ERROR, Messages.NOT_AUTHORIZED_FOR_BROWSING);
+		else if (!CommandHandler.isValidForGet(commandStr))
+			xr = new XmlResponse(XmlResponse.EN_ERROR, Messages.INVALID_COMMAND);
+		else if (typeStr != null && !ResourceTypeHandler.isValid(typeStr))
+			xr = new XmlResponse(XmlResponse.EN_ERROR, Messages.INVALID_TYPE);
+		else if (!UtilsFile.isValidPath(currentFolderStr))
+			xr = new XmlResponse(XmlResponse.EN_ERROR, Messages.INVALID_CURRENT_FOLDER);
+		else {
+			CommandHandler command = CommandHandler.getCommand(commandStr);
+			ResourceTypeHandler resourceType = ResourceTypeHandler.getDefaultResourceType(typeStr);
+
+			String typePath = UtilsResponse.constructResponseUrl(request, resourceType,
+			        currentFolderStr, false, false);
+			String typeDirPath = getServletContext().getRealPath(typePath);
+
+			File typeDir = new File(typeDirPath);
+			UtilsFile.checkDirAndCreate(typeDir);
+
+			File currentDir = new File(typeDir, currentFolderStr);
+
+			if (!currentDir.exists())
+				xr = new XmlResponse(XmlResponse.EN_INVALID_FOLDER_NAME);
+			else {
+
+				xr = new XmlResponse(command, resourceType, currentFolderStr, UtilsResponse
+				        .constructResponseUrl(request, resourceType, currentFolderStr, true,
+				                ConnectorHandler.isFullUrl()));
+
+				if (command.equals(CommandHandler.GET_FOLDERS))
+					xr.setFolders(currentDir);
+				else if (command.equals(CommandHandler.GET_FOLDERS_AND_FILES))
+					xr.setFoldersAndFiles(currentDir);
+				else if (command.equals(CommandHandler.CREATE_FOLDER)) {
+					String newFolderStr = UtilsFile.sanitizeFolderName(request
+					        .getParameter("NewFolderName"));
+					logger.debug("Parameter NewFolderName: {}", newFolderStr);
+
+					File newFolder = new File(currentDir, newFolderStr);
+					int errorNumber = XmlResponse.EN_UKNOWN;
+
+					if (newFolder.exists())
+						errorNumber = XmlResponse.EN_ALREADY_EXISTS;
+					else {
+						try {
+							errorNumber = (newFolder.mkdir()) ? XmlResponse.EN_OK
+							        : XmlResponse.EN_INVALID_FOLDER_NAME;
+						} catch (SecurityException e) {
+							errorNumber = XmlResponse.EN_SECURITY_ERROR;
+						}
+					}
+					xr.setError(errorNumber);
+				}
+			}
+		}
+
+		out.print(xr);
+		out.flush();
+		out.close();
+		logger.debug("Exiting ConnectorServlet#doGet");
+	}
+
+	/**
+	 * Manage the Post requests (FileUpload).<br>
+	 * 
+	 * The servlet accepts commands sent in the following format:<br>
+	 * connector?Command=FileUpload&Type=ResourceType&CurrentFolder=FolderPath<br>
+	 * <br>
+	 * It store the file (renaming it in case a file with the same name exists) and then return an
+	 * HTML file with a javascript command in it.
+	 */
+	public void doPost(HttpServletRequest request, HttpServletResponse response)
+	        throws ServletException, IOException {
+		logger.debug("Entering Connector#doPost");
+
+		response.setCharacterEncoding("UTF-8");
+		response.setContentType("text/html; charset=UTF-8");
+		response.setHeader("Cache-Control", "no-cache");
+		PrintWriter out = response.getWriter();
+
+		String commandStr = request.getParameter("Command");
+		String typeStr = request.getParameter("Type");
+		String currentFolderStr = request.getParameter("CurrentFolder");
+
+		logger.debug("Parameter Command: {}", commandStr);
+		logger.debug("Parameter Type: {}", typeStr);
+		logger.debug("Parameter CurrentFolder: {}", currentFolderStr);
+
+		UploadResponse ur;
+
+		// if this is a QuickUpload-Request, 'commandStr' and 'currentFolderStr' are empty
+		if (Utils.isEmpty(commandStr) && Utils.isEmpty(currentFolderStr)) {
+			commandStr = "QuickUpload";
+			currentFolderStr = "/";
+		}
+
+		if (!SessionDataHandler.isEnabledForFileUpload(request))
+			ur = new UploadResponse(UploadResponse.EN_SECURITY_ERROR, null, null,
+			        Messages.NOT_AUTHORIZED_FOR_UPLOAD);
+		else if (!CommandHandler.isValidForPost(commandStr))
+			ur = new UploadResponse(UploadResponse.EN_ERROR, null, null, Messages.INVALID_COMMAND);
+		else if (typeStr != null && !ResourceTypeHandler.isValid(typeStr))
+			ur = new UploadResponse(UploadResponse.EN_ERROR, null, null, Messages.INVALID_TYPE);
+		else if (!UtilsFile.isValidPath(currentFolderStr))
+			ur = UploadResponse.UR_INVALID_CURRENT_FOLDER;
+		else {
+			ResourceTypeHandler resourceType = ResourceTypeHandler.getDefaultResourceType(typeStr);
+
+			String typePath = UtilsResponse.constructResponseUrl(request, resourceType,
+			        currentFolderStr, false, false);
+			String typeDirPath = getServletContext().getRealPath(typePath);
+
+			File typeDir = new File(typeDirPath);
+			UtilsFile.checkDirAndCreate(typeDir);
+
+			File currentDir = new File(typeDir, currentFolderStr);
+
+			if (!currentDir.exists())
+				ur = UploadResponse.UR_INVALID_CURRENT_FOLDER;
+			else {
+
+				String newFilename = null;
+				FileItemFactory factory = new DiskFileItemFactory();
+				ServletFileUpload upload = new ServletFileUpload(factory);
+
+				try {
+
+					List<FileItem> items = upload.parseRequest(request);
+
+					// We upload only one file at the same time
+					FileItem uplFile = items.get(0);
+					String rawName = UtilsFile.sanitizeFileName(uplFile.getName());
+					String filename = FilenameUtils.getName(rawName);
+					String baseName = FilenameUtils.removeExtension(filename);
+					String extension = FilenameUtils.getExtension(filename);
+
+					if (!ExtensionsHandler.isAllowed(resourceType, extension))
+						ur = new UploadResponse(UploadResponse.EN_INVALID_EXTENSION);
+					else {
+
+						// construct an unique file name
+						File pathToSave = new File(currentDir, filename);
+						int counter = 1;
+						while (pathToSave.exists()) {
+							newFilename = baseName.concat("(").concat(String.valueOf(counter))
+							        .concat(")").concat(".").concat(extension);
+							pathToSave = new File(currentDir, newFilename);
+							counter++;
+						}
+
+						if (Utils.isEmpty(newFilename))
+							ur = new UploadResponse(UploadResponse.EN_OK, UtilsResponse
+							        .constructResponseUrl(request, resourceType, currentFolderStr,
+							                true, ConnectorHandler.isFullUrl()).concat(filename));
+						else
+							ur = new UploadResponse(UploadResponse.EN_RENAMED,
+							        UtilsResponse.constructResponseUrl(request, resourceType,
+							                currentFolderStr, true, ConnectorHandler.isFullUrl())
+							                .concat(newFilename), newFilename);
+
+						// secure image check
+						if (resourceType.equals(ResourceTypeHandler.IMAGE)
+						        && ConnectorHandler.isSecureImageUploads()) {
+							if (UtilsFile.isImage(uplFile.getInputStream()))
+								uplFile.write(pathToSave);
+							else {
+								uplFile.delete();
+								ur = new UploadResponse(UploadResponse.EN_INVALID_EXTENSION);
+							}
+						} else
+							uplFile.write(pathToSave);
+
+					}
+				} catch (Exception e) {
+					ur = new UploadResponse(UploadResponse.EN_SECURITY_ERROR);
+				}
+			}
+
+		}
+
+		out.print(ur);
+		out.flush();
+		out.close();
+
+		logger.debug("Exiting Connector#doPost");
+	}
+
+}
Index: /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/connector/Messages.java
===================================================================
--- /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/connector/Messages.java	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/connector/Messages.java	(revision 1893)
@@ -0,0 +1,20 @@
+package net.fckeditor.connector;
+
+public class Messages {
+
+	/** Error message NOT AUTHORIZED FOR FILE UPLOAD */
+	public static final String NOT_AUTHORIZED_FOR_UPLOAD = "The current user isn't authorized for file upload!";
+
+	/** Error message NOT AUTHORIZED FOR FILE BROWSING */
+	public static final String NOT_AUTHORIZED_FOR_BROWSING = "The current user isn't authorized for file browsing!";
+
+	/** Error message INVALID COMMAND SUPPLIED */
+	public static final String INVALID_COMMAND = "Invalid command specified";
+
+	/** Error message INVALID TYPE SUPPLIED */
+	public static final String INVALID_TYPE = "Invalid resource type specified";
+
+	/** Error message INVALID CURRENT FOLDER */
+	public static final String INVALID_CURRENT_FOLDER = "Invalid current folder specified";
+
+}
Index: /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/handlers/CommandHandler.java
===================================================================
--- /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/handlers/CommandHandler.java	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/handlers/CommandHandler.java	(revision 1893)
@@ -0,0 +1,157 @@
+/*
+ * 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.handlers;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Handler for the get and post commands.
+ * 
+ * @version $Id: ResourceTypeHandler.java 1606 2008-02-24 17:07:52Z th-schwarz $
+ */
+public class CommandHandler {
+
+	private String name;
+	private static Map<String, CommandHandler> getCommands = new HashMap<String, CommandHandler>(
+	        3);
+	private static Map<String, CommandHandler> postCommands = new HashMap<String, CommandHandler>(
+	        2);
+	public static final CommandHandler GET_FOLDERS = new CommandHandler("GetFolders");
+	public static final CommandHandler GET_FOLDERS_AND_FILES = new CommandHandler("GetFoldersAndFiles");
+	public static final CommandHandler CREATE_FOLDER = new CommandHandler("CreateFolder");
+	public static final CommandHandler FILE_UPLOAD = new CommandHandler("FileUpload");
+	public static final CommandHandler QUICK_UPLOAD = new CommandHandler("QuickUpload");
+
+	static {
+		// initialize the get commands
+		getCommands.put(GET_FOLDERS.getName(), GET_FOLDERS);
+		getCommands.put(GET_FOLDERS_AND_FILES.getName(), GET_FOLDERS_AND_FILES);
+		getCommands.put(CREATE_FOLDER.getName(), CREATE_FOLDER);
+		
+		// initialize the post commands
+		postCommands.put(FILE_UPLOAD.getName(), FILE_UPLOAD);
+		postCommands.put(QUICK_UPLOAD.getName(), QUICK_UPLOAD);
+	}
+
+	private CommandHandler(final String name) {
+		this.name = name;
+	}
+
+	/**
+	 * Getter for the name.
+	 * 
+	 * @return name
+	 */
+	public String getName() {
+		return name;
+	}
+
+	/**
+	 * Getter for an {@link CommandHandler} of a specified string.
+	 * 
+	 * @param name
+	 * @return A {@link CommandHandler} object holding the value represented by the string
+	 *         argument.
+	 * @throws IllegalArgumentException
+	 *             If 'name' is null or can't be parsed.
+	 */
+	public static CommandHandler valueOf(final String name) throws IllegalArgumentException {
+		if (name == null)
+			throw new IllegalArgumentException();
+
+		if (!isValidForGet(name) && !isValidForPost(name))
+			throw new IllegalArgumentException();
+		return (getCommands.get(name) != null) ? getCommands.get(name) : postCommands.get(name);
+	}
+	
+
+	/**
+	 * Checks, if a specfied string is a valid representation of a get command.
+	 * 
+	 * @param name
+	 * @return True, if the string representation is valid, or false.
+	 */
+	public static boolean isValidForGet(final String name) {
+		return getCommands.containsKey(name);
+	}
+
+	/**
+	 * Checks, if a specfied string is a valid representation of a post command.
+	 * 
+	 * @param name
+	 * @return True, if the string representation is valid, or false.
+	 */
+	public static boolean isValidForPost(final String name) {
+		return postCommands.containsKey(name);
+	}
+	
+	
+	/**
+	 * A wrapper for {@link #valueOf(String)}. It returns null instead of throwing an exception.
+	 * 
+	 * @param name
+	 * @return A {@link CommandHandler} object holding the value represented by the string
+	 *         argument, or null.
+	 */
+	public static CommandHandler getCommand(final String name) {
+		try {
+			return CommandHandler.valueOf(name);
+		} catch (Exception e) {
+			return null;
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see java.lang.Object#equals(java.lang.Object)
+	 */
+	@Override
+	public boolean equals(Object obj) {
+		try {
+			CommandHandler rt = (CommandHandler) obj;
+			return name.equals(rt.getName());
+		} catch (ClassCastException e) {
+			return false;
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see java.lang.Object#toString()
+	 */
+	@Override
+	public int hashCode() {
+		return name.hashCode();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see java.lang.Object#toString()
+	 */
+	@Override
+	public String toString() {
+		return name;
+	}
+}
Index: /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/handlers/ConnectorHandler.java
===================================================================
--- /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/handlers/ConnectorHandler.java	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/handlers/ConnectorHandler.java	(revision 1893)
@@ -0,0 +1,81 @@
+/*
+ * 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.handlers;
+
+import javax.servlet.http.HttpServletRequest;
+
+import net.fckeditor.SessionData;
+
+/**
+ * Handler for some base properties.
+ * 
+ * @version $Id$
+ */
+public class ConnectorHandler {
+
+	/**
+     * Getter for the base dir (using for user files).
+     * 
+     * @return {@link SessionData#getUserFilesPath(HttpServletRequest)} or the default base dir, if
+     *         {@link SessionData}} isn't set.
+     */
+    public static String getUserFilesPath(final HttpServletRequest servletRequest) {
+    	String userFilePath = SessionDataHandler.getUserFilePath(servletRequest);
+    	return (userFilePath != null) ? userFilePath : getDefaultUserFilesPath();
+    }
+
+	/**
+	 * Getter for the default handling of single extensions.
+	 * 
+	 * @return the forceSingleExtension
+	 */
+	public static boolean isForceSingleExtension() {
+		return Boolean.valueOf(PropertiesLoader.getProperty("connector.forceSingleExtension"));
+	}
+
+	/**
+	 * Getter for the value to instruct the connector to return the full URL of a file/folder in the
+	 * XML response rather than the absolute URL.
+	 * 
+	 * @return Boolean value of the property 'connector.fullUrl'.
+	 */
+	public static boolean isFullUrl() {
+		return Boolean.valueOf(PropertiesLoader.getProperty("connector.fullUrl"));
+	}
+
+	/**
+	 * Getter for the default userFilesPath.
+	 * 
+	 * @return Default userfiles path (/userfiles)
+	 */
+	public static String getDefaultUserFilesPath() {
+		return PropertiesLoader.getProperty("connector.userFilesPath");
+	}
+	
+	/**
+	 * Getter for the value to instruct the Connector to check, if the uploaded image is really one.
+	 * 
+	 * @return Boolean value of the property 'connector.secureImageUploads'.
+	 */
+	public static boolean isSecureImageUploads() {
+		return Boolean.valueOf(PropertiesLoader.getProperty("connector.secureImageUploads"));
+	}
+}
Index: /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/handlers/ExtensionsHandler.java
===================================================================
--- /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/handlers/ExtensionsHandler.java	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/handlers/ExtensionsHandler.java	(revision 1893)
@@ -0,0 +1,137 @@
+/*
+ * 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.handlers;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import net.fckeditor.tool.Utils;
+
+/**
+ * Handler which manages the allowed and denied extensions for each resource type. The
+ * extensions are preset by the properties managed by {@link PropertiesLoader}.<br>
+ * <br>
+ * Hint: It's recomment to 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$
+ */
+public class ExtensionsHandler {
+
+	private static Map<ResourceTypeHandler, Set<String>> extensionsAllowed = new HashMap<ResourceTypeHandler, Set<String>>();
+	private static Map<ResourceTypeHandler, Set<String>> extensionsDenied = new HashMap<ResourceTypeHandler, Set<String>>();
+
+	static {
+		// load defaults
+		extensionsAllowed.put(ResourceTypeHandler.FILE, Utils.getSet(PropertiesLoader
+		    .getProperty("connector.resourceType.file.extensions.allowed")));
+		extensionsDenied.put(ResourceTypeHandler.FILE, Utils.getSet(PropertiesLoader
+		    .getProperty("connector.resourceType.file.extensions.denied")));
+		extensionsAllowed.put(ResourceTypeHandler.MEDIA, Utils.getSet(PropertiesLoader
+		    .getProperty("connector.resourceType.media.extensions.allowed")));
+		extensionsDenied.put(ResourceTypeHandler.MEDIA, Utils.getSet(PropertiesLoader
+		    .getProperty("connector.resourceType.media.extensions.denied")));
+		extensionsAllowed.put(ResourceTypeHandler.IMAGE, Utils.getSet(PropertiesLoader
+		    .getProperty("connector.resourceType.image.extensions.allowed")));
+		extensionsDenied.put(ResourceTypeHandler.IMAGE, Utils.getSet(PropertiesLoader
+		    .getProperty("connector.resourceType.image.extensions.denied")));
+		extensionsAllowed.put(ResourceTypeHandler.FLASH, Utils.getSet(PropertiesLoader
+		    .getProperty("connector.resourceType.flash.extensions.allowed")));
+		extensionsDenied.put(ResourceTypeHandler.FLASH, Utils.getSet(PropertiesLoader
+		    .getProperty("connector.resourceType.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 ResourceTypeHandler type) {
+		return extensionsAllowed.get(type);
+	}
+
+	/**
+	 * 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 ResourceTypeHandler 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 ResourceTypeHandler type) {
+		return extensionsDenied.get(type);
+	}
+
+	/**
+	 * 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 ResourceTypeHandler 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. False is returned too, if 'type' or 'extensions' is null.
+	 */
+	public static boolean isAllowed(final ResourceTypeHandler type, final String extension) {
+		if (type == null || extension == null)
+			return false;
+		String ext = extension.toLowerCase();
+		Set<String> allowed = extensionsAllowed.get(type);
+		Set<String> denied = extensionsDenied.get(type);
+		if (allowed.isEmpty())
+			return !denied.contains(ext);
+		if (denied.isEmpty())
+			return allowed.contains(ext);
+		return false;
+	}
+}
Index: /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/handlers/PropertiesLoader.java
===================================================================
--- /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/handlers/PropertiesLoader.java	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/handlers/PropertiesLoader.java	(revision 1893)
@@ -0,0 +1,101 @@
+/*
+ * 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.handlers;
+
+import java.io.BufferedInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+import net.fckeditor.tool.Utils;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Handler to hold the basic properties.<br>
+ * The main default file is 'default.properties' in the deepth of the classpath and should be
+ * untouched. If there is a file named 'fckeditor.properties' in the root of the classpath, it will
+ * be loaded. Values which are loaded before, will be overwritten.<br>
+ * If you won't use an extra properties file to adjust the defaults, you can use
+ * {@link #setProperty(String, String)} instead.
+ * 
+ * @version $Id$
+ */
+public class PropertiesLoader {
+	private static final Logger logger = LoggerFactory.getLogger(PropertiesLoader.class);
+	private static Properties properties = new Properties();
+
+	static {
+		try {
+			// 1. load system defaults
+			properties.load(new BufferedInputStream(PropertiesLoader.class
+			        .getResourceAsStream("default.properties")));
+
+			// 2. load user defaults
+			InputStream in = PropertiesLoader.class.getResourceAsStream("/fckeditor.properties");
+			if (in == null)
+				logger.warn("Can't find user properties!");
+			else {
+				try {
+					properties.load(new BufferedInputStream(in));
+					logger.info("User's properties loaded successfully!");
+				} catch (IOException e) {
+					logger.error("Error while loading user properties!", e);
+					throw new RuntimeException("Can't load user properties!", e);
+				}
+			}
+		} catch (IOException e) {
+			logger.error("Error while loading default properties!", e);
+			throw new RuntimeException("Can't load default properties!", e);
+		}
+	}
+
+	/**
+	 * Getter for a property of 'key'.
+	 * 
+	 * @param key
+	 *            the propery key
+	 * @return the value in this property list with the specified key value.
+	 * @see Properties#getProperty(String)
+	 */
+	public static String getProperty(final String key) {
+		return properties.getProperty(key);
+	}
+
+	/**
+	 * Setter for a property. If the property already exists, the value will be overwritten.<br>
+	 * Hint: This method is intended for an alternative way to set user defaults programmatically
+	 * instead of using the 'fckeditor.properties'. It should never used inside FCKeditor.Java !!!
+	 * 
+	 * @param key
+	 *            key the propery key
+	 * @param value
+	 * @throws IllegalArgumentException
+	 *             if 'key' is empty.
+	 * @see Properties#setProperty(String, String)
+	 */
+	public static void setProperty(final String key, final String value) {
+		if (Utils.isEmpty(key))
+			new IllegalArgumentException("The 'key' of a property schouldn't be null!");
+		properties.setProperty(key, value);
+	}
+}
Index: /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/handlers/ResourceTypeHandler.java
===================================================================
--- /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/handlers/ResourceTypeHandler.java	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/handlers/ResourceTypeHandler.java	(revision 1893)
@@ -0,0 +1,162 @@
+/*
+ * 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.handlers;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Handler for the different resource types.
+ * 
+ * @version $Id$
+ */
+public class ResourceTypeHandler {
+
+	private String name;
+	private static Map<String, ResourceTypeHandler> types = new HashMap<String, ResourceTypeHandler>(
+	        4);
+	private static Map<ResourceTypeHandler, String> paths = new HashMap<ResourceTypeHandler, String>(
+	        4);
+	public static final ResourceTypeHandler FILE = new ResourceTypeHandler("File");
+	public static final ResourceTypeHandler FLASH = new ResourceTypeHandler("Flash");
+	public static final ResourceTypeHandler IMAGE = new ResourceTypeHandler("Image");
+	public static final ResourceTypeHandler MEDIA = new ResourceTypeHandler("Media");
+
+	static {
+		// initialize the resource types
+		types.put(FILE.getName(), FILE);
+		types.put(FLASH.getName(), FLASH);
+		types.put(IMAGE.getName(), IMAGE);
+		types.put(MEDIA.getName(), MEDIA);
+
+		// initialize the sub folders for each resource type
+		paths.put(FILE, PropertiesLoader.getProperty("connector.resourceType.file.path"));
+		paths.put(IMAGE, PropertiesLoader.getProperty("connector.resourceType.image.path"));
+		paths.put(FLASH, PropertiesLoader.getProperty("connector.resourceType.flash.path"));
+		paths.put(MEDIA, PropertiesLoader.getProperty("connector.resourceType.media.path"));
+	}
+
+	private ResourceTypeHandler(final String name) {
+		this.name = name;
+	}
+
+	/**
+	 * Getter for the name.
+	 * 
+	 * @return name
+	 */
+	public String getName() {
+		return name;
+	}
+
+	/**
+	 * Getter for the path (sub folder).
+	 * 
+	 * @return The path (sub folder).
+	 */
+	public String getPath() {
+		return paths.get(this);
+	}
+
+	/**
+	 * Getter for an {@link ResourceTypeHandler} of a specified string.
+	 * 
+	 * @param name
+	 * @return A {@link ResourceTypeHandler} object holding the value represented by the string
+	 *         argument.
+	 * @throws IllegalArgumentException
+	 *             If 'name' is null can't be parsed.
+	 */
+	public static ResourceTypeHandler valueOf(final String name) throws IllegalArgumentException {
+		if (name == null)
+			throw new IllegalArgumentException();
+
+		ResourceTypeHandler rt = types.get(name);
+		if (rt == null)
+			throw new IllegalArgumentException();
+		return rt;
+	}
+
+	/**
+	 * Checks, if a specfied string is valid representation of a {@link ResourceTypeHandler}.
+	 * 
+	 * @param name
+	 * @return True, if the string represrntation is valid, or false.
+	 */
+	public static boolean isValid(final String name) {
+		return types.containsKey(name);
+	}
+
+	public static ResourceTypeHandler getDefaultResourceType(final String name) {
+		ResourceTypeHandler rt = getResourceType(name);
+		return rt == null ? FILE : rt;
+	}
+
+	/**
+	 * A wrapper for {@link #valueOf(String)}. It returns null instead of throwing an exception.
+	 * 
+	 * @param name
+	 * @return A {@link ResourceTypeHandler} object holding the value represented by the string
+	 *         argument, or null.
+	 */
+	public static ResourceTypeHandler getResourceType(final String name) {
+		try {
+			return ResourceTypeHandler.valueOf(name);
+		} catch (Exception e) {
+			return null;
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see java.lang.Object#equals(java.lang.Object)
+	 */
+	@Override
+	public boolean equals(Object obj) {
+		try {
+			ResourceTypeHandler rt = (ResourceTypeHandler) obj;
+			return name.equals(rt.getName());
+		} catch (ClassCastException e) {
+			return false;
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see java.lang.Object#toString()
+	 */
+	@Override
+	public int hashCode() {
+		return name.hashCode();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see java.lang.Object#toString()
+	 */
+	@Override
+	public String toString() {
+		return name;
+	}
+}
Index: /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/handlers/SessionDataHandler.java
===================================================================
--- /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/handlers/SessionDataHandler.java	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/handlers/SessionDataHandler.java	(revision 1893)
@@ -0,0 +1,90 @@
+/*
+ * 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.handlers;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import net.fckeditor.SessionData;
+
+/**
+ * Handler for session based data provided by {@link SessionData}.
+ * 
+ * @version $Id$
+ */
+public class SessionDataHandler {
+	private static Logger logger = LoggerFactory.getLogger(SessionDataHandler.class);
+	private static SessionData sessionData = null;
+
+	static {
+		// try to instanciate the SessionData object
+		String fqcn = PropertiesLoader.getProperty("connector.sessionDataImpl");
+		if (fqcn == null)
+			logger.warn("No property found for SessionData implementation, any user action is disabled!");
+		else {
+			try {
+				@SuppressWarnings("unchecked")
+				Class clazz = Class.forName(fqcn);
+				sessionData = (SessionData) clazz.newInstance();
+				logger.info("SessionData object successfull instanciated!");
+			} catch (Exception e) {
+				logger.error("Couldn't instanciate the class [".concat(fqcn).concat(
+				        "], any user action of the ConnectorServlet is disabled!"), e);
+			}
+		}
+	}
+
+	/**
+	 * Just a wrapper to {@link SessionData#isEnabledForFileBrowsing(HttpServletRequest)}.
+	 * 
+	 * @param servletRequest
+	 * @return {@link SessionData#isEnabledForFileBrowsing(HttpServletRequest)} or false, if
+	 *         sessionData isn't set.
+	 */
+	public static boolean isEnabledForFileBrowsing(final HttpServletRequest servletRequest) {
+		return (sessionData != null && sessionData.isEnabledForFileBrowsing(servletRequest));
+	}
+
+	/**
+	 * Just a wrapper to {@link SessionData#isEnabledForFileUpload(HttpServletRequest)}.
+	 * 
+	 * @param request
+	 * @return {@link SessionData#isEnabledForFileUpload(HttpServletRequest)} or false, if
+	 *         sessionData isn't set.
+	 */
+	public static boolean isEnabledForFileUpload(final HttpServletRequest request) {
+		return (sessionData != null && sessionData.isEnabledForFileUpload(request));
+	}
+
+	/**
+	 * Getter for the user's file path.<br>
+	 * Method is used by other handlers only!
+	 * 
+	 * @param request
+	 * @return {@link SessionData#getUserFilesPath(HttpServletRequest)} or null, if sessionData is
+	 *         null.
+	 */
+	protected static String getUserFilePath(final HttpServletRequest request) {
+		return (sessionData != null) ? sessionData.getUserFilesPath(request) : null;
+	}
+}
Index: /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/impl/BasicSessionData.java
===================================================================
--- /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/impl/BasicSessionData.java	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/impl/BasicSessionData.java	(revision 1893)
@@ -0,0 +1,54 @@
+/*
+ * 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.impl;
+
+import javax.servlet.http.HttpServletRequest;
+
+import net.fckeditor.SessionData;
+
+/**
+ * The most simple implementation of {@link SessionData}.
+ *
+ * @version $Id$
+ */
+public class BasicSessionData implements SessionData {
+
+	/* (non-Javadoc)
+     * @see net.fckeditor.SessionData#getBaseDir(javax.servlet.http.HttpServletRequest)
+     */
+    public String getUserFilesPath(final HttpServletRequest servletRequest) {
+	    return null;
+    }
+
+	/* (non-Javadoc)
+     * @see net.fckeditor.SessionData#isEnabledForFileBrowsing(javax.servlet.http.HttpServletRequest)
+     */
+    public boolean isEnabledForFileBrowsing(final HttpServletRequest servletRequest) {
+	    return true;
+    }
+
+	/* (non-Javadoc)
+     * @see net.fckeditor.SessionData#isEnabledForFileUpload(javax.servlet.http.HttpServletRequest)
+     */
+    public boolean isEnabledForFileUpload(final HttpServletRequest servletRequest) {
+	    return true;
+    }	
+}
Index: /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/response/UploadResponse.java
===================================================================
--- /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/response/UploadResponse.java	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/response/UploadResponse.java	(revision 1893)
@@ -0,0 +1,160 @@
+/*
+ * 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.response;
+
+import net.fckeditor.connector.Messages;
+import net.fckeditor.tool.Utils;
+
+/**
+ * Simply abstracts from the javascript callback to a java class.
+ * 
+ * <p>
+ * The usage is quite easy but can be tricky since varargs are used in the class
+ * constructor.<br/> The requestor expects a JS method callback with variable
+ * arguments size.
+ * </p>
+ * <p>
+ * e.g.
+ * <code>window.parent.OnUploadCompleted(101,'some/url/file.img','file.img','no error');</code>
+ * </p>
+ * <p>
+ * The UploadResponse constructor behaves the same way by simply calling it
+ * with:<br/>
+ * <code>UploadResponse ur = new UploadResonse(EN_SOME_ERROR,"/some/url/file.img","file.img","no error"):</code>
+ * </p>
+ * 
+ * @since 2.4
+ * @version $Id$
+ */
+public class UploadResponse {
+
+	private Object[] parameters;
+
+	// TODO Rename 'En_'-constants to something more intuitive like 'CODE_'
+	/** Error number OK */
+	public static final int EN_OK = 0;
+
+	/** Error number ERROR */
+	public static final int EN_ERROR = 1;
+
+	/** Error number RENAMED */
+	public static final int EN_RENAMED = 201;
+
+	/** Error number INVALID EXTENSION */
+	public static final int EN_INVALID_EXTENSION = 202;
+
+	/** Error number SECURITY ERROR */
+	public static final int EN_SECURITY_ERROR = 203;
+	
+	/** UploadResponse INVALID CURRENT FOLDER */
+	public static final UploadResponse UR_INVALID_CURRENT_FOLDER = new UploadResponse(
+			UploadResponse.EN_ERROR, null, null,
+			Messages.INVALID_CURRENT_FOLDER);
+
+	/**
+	 * Constructs the response with variable amount of parameters.
+	 * <p>
+	 * Put the desired parameters in the constructor. You may omit them from
+	 * right to left but you have to remain the order.<br/> e.g.
+	 * <code>UploadResponse(EN_OK,"/some/url/to/pic.jpg","pic")</code> or
+	 * <code>UploadResponse(EN_OK)</code> but <b>not</b>
+	 * <code>UploadResponse(EN_OK,"some error message")</code>
+	 * </p>
+	 * <p>
+	 * Use, if possible, the pre-defined error numbers or upload responses.
+	 * </p>
+	 * <p>
+	 * If you need to set error number and message only, use constructor with
+	 * one paremeter and call {@link UploadResponse#setCustomMessage(String)}.
+	 * 
+	 * @param arguments
+	 *            possible argument order:
+	 *            <code>int errorNumber, String fileUrl, String filename, String customMessage</code>
+	 * @throws IllegalArgumentException
+	 *             if amount of arguments is less than 1 and above 4
+	 * @throws IllegalArgumentException
+	 *             if the first argument is not an error number (int)
+	 */
+
+	public UploadResponse(Object... arguments) throws IllegalArgumentException {
+		if (arguments.length < 1 || arguments.length > 4)
+			throw new IllegalArgumentException(
+					"The amount of arguments has to be between 1 and 4");
+
+		parameters = new Object[arguments.length];
+
+		if (!(arguments[0] instanceof Integer))
+			throw new IllegalArgumentException(
+					"The first argument has to be an error number (int)");
+
+		System.arraycopy(arguments, 0, parameters, 0, arguments.length);
+	}
+
+	/**
+	 * Sets the message in the UploadResponse.
+	 * 
+	 * Methods automatically determines how many arguments are set and puts the
+	 * message at the end.
+	 * 
+	 * @param customMassage
+	 *            the message you want to pass to the user
+	 */
+	public void setCustomMessage(final String customMassage) {
+		if (Utils.isNotEmpty(customMassage)) {
+			if (parameters.length == 1) {
+				Object errorNumber = parameters[0];
+				parameters = new Object[4];
+				parameters[0] = errorNumber;
+				parameters[1] = null;
+				parameters[2] = null;
+			}
+			parameters[3] = customMassage;
+		}
+	}
+
+	/**
+	 * Assembles the JavaScript method for the user callback
+	 */
+	@Override
+	public String toString() {
+		StringBuffer sb = new StringBuffer(75);
+		sb.append("<script type=\"text/javascript\">\n");
+		sb.append("window.parent.OnUploadCompleted(");
+
+		for (Object parameter : parameters) {
+			if (parameter instanceof Integer) {
+				sb.append(parameter);
+			} else {
+				sb.append("'");
+				if (parameter != null)
+					sb.append(parameter);
+				sb.append("'");
+			}
+			sb.append(",");
+		}
+
+		sb.deleteCharAt(sb.length() - 1);
+		sb.append(");\n");
+		sb.append("</script>");
+
+		return sb.toString();
+	}
+}
Index: /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/response/XmlResponse.java
===================================================================
--- /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/response/XmlResponse.java	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/response/XmlResponse.java	(revision 1893)
@@ -0,0 +1,223 @@
+/*
+ * 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.response;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.io.StringWriter;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import net.fckeditor.handlers.CommandHandler;
+import net.fckeditor.handlers.ResourceTypeHandler;
+import net.fckeditor.tool.Utils;
+
+import org.apache.commons.io.filefilter.DirectoryFileFilter;
+import org.apache.commons.io.filefilter.FileFileFilter;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+/**
+ * static error objects won't probably provided due to performance reasons of 
+ * Document instance creation
+ * 
+ * TODO document me!
+ * @author mosipov
+ *
+ */
+public class XmlResponse {
+
+	private Document document;
+	private Element errorElement;
+	private Element foldersElement;
+	private Element filesElement;
+	
+	/** Error number OK */
+	public static final int EN_OK = 0;
+	
+	/** Error number ERROR */
+	public static final int EN_ERROR = 1;
+
+	/** Error number ALREADY EXISTS */
+	public static final int EN_ALREADY_EXISTS = 101;
+
+	/** Error number INVALID FOLDER NAME */
+	public static final int EN_INVALID_FOLDER_NAME = 102;
+
+	/** Error number SECURITY ERROR */
+	public static final int EN_SECURITY_ERROR = 103;
+
+	/** Error number UNKNOWN ERROR */
+	public static final int EN_UKNOWN = 110;
+
+	/**
+	 * 
+	 * @param command
+	 * @param resourceType
+	 * @param currentFolder
+	 * @param constructedUrl
+	 */
+	public XmlResponse(CommandHandler command, ResourceTypeHandler resourceType, 
+			String currentFolder, String constructedUrl) {
+
+		try {
+			DocumentBuilderFactory factory = DocumentBuilderFactory
+					.newInstance();
+			DocumentBuilder builder = factory.newDocumentBuilder();
+			document = builder.newDocument();
+		} catch (ParserConfigurationException e) {
+			throw new RuntimeException(e);
+		}
+
+		Element root = document.createElement("Connector");
+		document.appendChild(root);
+		root.setAttribute("command", command.toString());
+		root.setAttribute("resourceType", resourceType.toString());
+
+		Element currentFolderElement = document.createElement("CurrentFolder");
+		currentFolderElement.setAttribute("path", currentFolder);
+
+		currentFolderElement.setAttribute("url", constructedUrl);
+		root.appendChild(currentFolderElement);
+
+	}
+	
+	/**
+	 * TODO document me!
+	 * @param number
+	 * @param text
+	 */
+	public XmlResponse(int number, String text) {
+		try {
+			DocumentBuilderFactory factory = DocumentBuilderFactory
+					.newInstance();
+			DocumentBuilder builder = factory.newDocumentBuilder();
+			document = builder.newDocument();
+		} catch (ParserConfigurationException e) {
+			throw new RuntimeException(e);
+		}
+
+		Element root = document.createElement("Connector");
+		document.appendChild(root);
+		setError(number, text);
+	}
+	
+	/***
+	 * TODO document me!
+	 * @param number
+	 */
+	public XmlResponse(int number) {
+		this(number, null);
+	}
+
+	public void setError(int number, String text) {
+
+		if (errorElement == null) {
+			errorElement = document.createElement("Error");
+			document.getDocumentElement().appendChild(errorElement);
+		}
+
+		errorElement.setAttribute("number", String.valueOf(number));
+		if (Utils.isNotEmpty(text))
+			errorElement.setAttribute("text", text);
+
+	}
+
+	public void setError(int number) {
+		setError(number, null);
+	}
+
+	public void setFolders(File dir) {
+
+		if (foldersElement != null) {
+			Element parent = (Element) foldersElement.getParentNode();
+			parent.removeChild(foldersElement);
+		}
+
+		foldersElement = document.createElement("Folders");
+		document.getDocumentElement().appendChild(foldersElement);
+
+		String[] fileList = dir.list(DirectoryFileFilter.DIRECTORY);
+		for (String file : fileList) {
+			Element folderElement = document.createElement("Folder");
+			folderElement.setAttribute("name", file);
+			foldersElement.appendChild(folderElement);
+		}
+	}
+	
+	public void setFiles(File dir) {
+		
+		if (filesElement != null) {
+			Element parent = (Element) filesElement.getParentNode();
+			parent.removeChild(filesElement);
+		}
+
+		filesElement = document.createElement("Files");
+		document.getDocumentElement().appendChild(filesElement);
+		
+		File[] fileList = dir.listFiles((FileFilter) FileFileFilter.FILE);
+		long length;
+		for (File file : fileList) {
+			Element fileElement = document.createElement("File");
+			fileElement.setAttribute("name", file.getName());
+			if (file.length() < 1024)
+				length = 1L;
+			else 
+				length = file.length()/1024;
+			fileElement.setAttribute("size", String.valueOf(length));
+			filesElement.appendChild(fileElement);
+		}
+	}
+	
+	public void setFoldersAndFiles(File dir) {
+		setFolders(dir);
+		setFiles(dir);
+	}
+	
+	@Override
+	public String toString() {
+		document.getDocumentElement().normalize();
+		TransformerFactory factory = TransformerFactory.newInstance();
+
+		StringWriter sw = new StringWriter();
+
+		try {
+			Transformer transformer = factory.newTransformer();
+
+			DOMSource source = new DOMSource(document);
+			StreamResult result = new StreamResult(sw);
+
+			transformer.transform(source, result);
+		} catch (TransformerException e) {
+			throw new RuntimeException(e);
+		}
+
+		return sw.toString();
+	}
+
+}
Index: /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/tags/CheckTag.java
===================================================================
--- /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/tags/CheckTag.java	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/tags/CheckTag.java	(revision 1893)
@@ -0,0 +1,114 @@
+/*
+ * 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.tags;
+
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.JspTagException;
+import javax.servlet.jsp.JspWriter;
+import javax.servlet.jsp.tagext.TagSupport;
+
+import net.fckeditor.handlers.PropertiesLoader;
+import net.fckeditor.handlers.SessionDataHandler;
+import net.fckeditor.tool.Compatibility;
+
+/**
+ * CheckTag.java - TODO DOCUMENTME!
+ *
+ * @version $Id$
+ */
+public class CheckTag extends TagSupport {
+
+	private static final long serialVersionUID = -6834095891675681686L;
+
+	private static final String FILE_UPLOAD = "FileUpload";
+	private static final String FILE_BROWSING = "FileBrowsing";
+	private static final String COMPATIBLE_BROWSER = "CompatibleBrowser";
+	private static final String PROPERTY_MESSAGE_FILE_BROWSING_DISABLED = "message.enabled_tag.connector.file_browsing.disabled";
+	private static final String PROPERTY_MESSAGE_FILE_BROWSING_ENABLED = "message.enabled_tag.connector.file_browsing.enabled";
+	private static final String PROPERTY_MESSAGE_FILE_UPLOAD_DISABLED = "message.enabled_tag.connector.file_upload.disalbed";
+	private static final String PROPERTY_MESSAGE_FILE_UPLOAD_ENABLED = "message.enabled_tag.connector.file_upload.enabled";
+	private static final String PROPERTY_MESSAGE_NOT_COMPATIBLE_BROWSER = "message.enabled_tag.compatible_browser.no";
+	private static final String PROPERTY_MESSAGE_COMPATIBLE_BROWSER = "message.enabled_tag.compatible_browser.yes";
+	private static Set<String> commands = new HashSet<String>(3);
+
+	static {
+		commands.add(FILE_UPLOAD);
+		commands.add(FILE_BROWSING);
+		commands.add(COMPATIBLE_BROWSER);
+	}
+
+	private String command;
+
+	public void setCommand(String command) throws JspTagException {
+		if (!commands.contains(command))
+			throw new JspTagException("You have to provide one of the following commands: "
+			        + commands);
+		this.command = command;
+	}
+
+	@Override
+	public int doStartTag() throws JspException {
+		JspWriter out = pageContext.getOut();
+
+		HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
+		String response = new String();
+
+		if (command.equals(FILE_UPLOAD)) {
+			if (SessionDataHandler.isEnabledForFileUpload(request))
+				response = PropertiesLoader
+				        .getProperty(CheckTag.PROPERTY_MESSAGE_FILE_UPLOAD_ENABLED);
+			else
+				response = PropertiesLoader
+				        .getProperty(CheckTag.PROPERTY_MESSAGE_FILE_UPLOAD_DISABLED);
+		}
+
+		if (command.equals(FILE_BROWSING)) {
+			if (SessionDataHandler.isEnabledForFileBrowsing(request))
+				response = PropertiesLoader
+				        .getProperty(CheckTag.PROPERTY_MESSAGE_FILE_BROWSING_ENABLED);
+			else
+				response = PropertiesLoader
+				        .getProperty(CheckTag.PROPERTY_MESSAGE_FILE_BROWSING_DISABLED);
+		}
+		if (command.equals(COMPATIBLE_BROWSER)) {
+			if (Compatibility.isCompatibleBrowser(request))
+				response = PropertiesLoader
+				        .getProperty(CheckTag.PROPERTY_MESSAGE_COMPATIBLE_BROWSER);
+			else
+				response = PropertiesLoader
+				        .getProperty(CheckTag.PROPERTY_MESSAGE_NOT_COMPATIBLE_BROWSER);
+		}
+
+		try {
+			out.print(response);
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+
+		return SKIP_BODY;
+	}
+
+}
Index: /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/tags/ConfigTag.java
===================================================================
--- /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/tags/ConfigTag.java	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/tags/ConfigTag.java	(revision 1893)
@@ -0,0 +1,61 @@
+/*
+ * 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.tags;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.DynamicAttributes;
+import javax.servlet.jsp.tagext.Tag;
+import javax.servlet.jsp.tagext.TagSupport;
+
+/**
+ * ConfigTag.java - TODO DOCUMENTME!
+ *
+ * @version $Id$
+ */
+public class ConfigTag extends TagSupport implements DynamicAttributes {
+
+	private Map<String, String> params = new HashMap<String, String>();
+	
+	private static final long serialVersionUID = -5282810094404700422L;
+
+	@Override
+	public int doStartTag() throws JspException {
+
+		Tag ancestor = findAncestorWithClass(this, EditorTag.class);
+		if (ancestor == null)
+			throw new JspException(
+					"the config tag can only be nested within an editor tag");
+		EditorTag editorTag = (EditorTag) ancestor;
+		editorTag.setConfigParamAll(params);
+		
+		return SKIP_BODY;
+	}
+
+	public void setDynamicAttribute(String arg0, String arg1, Object arg2)
+			throws JspException {
+		if (arg2 != null)
+			params.put(arg1, arg2.toString());
+	}
+
+}
Index: /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/tags/EditorTag.java
===================================================================
--- /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/tags/EditorTag.java	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/tags/EditorTag.java	(revision 1893)
@@ -0,0 +1,180 @@
+/*
+ * 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.tags;
+
+import java.io.IOException;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.JspWriter;
+import javax.servlet.jsp.tagext.TagSupport;
+
+import net.fckeditor.FCKeditor;
+
+/**
+ * TODO check, if usage sample in comment is correct !!! (Advanced usage) <br><br>
+ * 
+ * FCKeditor Tag class to access the
+ * {@linkplain net.fckeditor.FCKeditor container}.<br>
+ * <p>
+ * <b>Simple usage</b>:
+ * 
+ * <pre>
+ * &lt;FCK:editor
+ * 	instanceName=&quot;EditorAccessibility&quot;
+ * 	width=&quot;80%&quot;
+ * 	height=&quot;120&quot;
+ * 	toolbarSet=&quot;Accessibility&quot;
+ * &quot;&gt;This is another test. &lt;BR&gt;&lt;BR&gt;The &quot;Second&quot; row.&lt;/BR&gt;&lt;/FCK:editor&quot;&gt;
+ * </pre>
+ * 
+ * <p>
+ * In this example we set all the attribute for the fckedit tag.
+ * 
+ * <p>
+ * <b>Advanced usage of the tag</b>:
+ * 
+ * <pre>
+ * &lt;FCK:editor instanceName=&quot;EditorDefault&quot; basePath=&quot;/fckeditor/&quot;
+ * 	styleNames=&quot;;Style 1;Style 2; Style 3&quot; 
+ * 	fontNames=&quot;;Arial;Courier New;Times New Roman;Verdana&quot; &gt;
+ * 	This is some &lt;B&gt;sample text&lt;/B&gt;.
+ * &lt;/FCK:editor&gt;
+ * </pre>
+ * 
+ * In this example we set the id and the basePath of the editor (since it is
+ * /fckeditor/ we could have omitted it because it's already the default value).<br>
+ * Then we used the the optional attributes to set some advanced configuration
+ * settings.
+ * 
+ * @version $Id: EditorTag.java 1842 2008-03-29 16:32:15Z th-schwarz $
+ */
+public class EditorTag extends TagSupport {
+
+	private static final long serialVersionUID = -173091731589866140L;
+
+	private String instanceName;
+	private String width;
+	private String height;
+	private String toolbarSet;
+	private String value;
+	private String basePath;
+
+	/** The underlying FCKeditor object */
+	private FCKeditor fckEditor;
+
+	/**
+	 * Sets the name for the given editor instance
+	 * 
+	 * @param instanceName
+	 *            some name without whitespaces
+	 */
+	public void setInstanceName(String instanceName) {
+		this.instanceName = instanceName;
+	}
+
+	/**
+	 * Sets the width of the textarea
+	 * 
+	 * @param width
+	 *            width of the editor instance
+	 * 
+	 */
+	public void setWidth(String width) {
+		this.width = width;
+	}
+
+	/**
+	 * Sets the height of the textarea
+	 * 
+	 * @param height
+	 *            height of the editor instance
+	 */
+	public void setHeight(String height) {
+		this.height = height;
+	}
+
+	/**
+	 * Sets the name of the toolbar to display
+	 * 
+	 * @param toolbarSet
+	 *            toolbar set of the editor instance
+	 */
+	public void setToolbarSet(String toolbarSet) {
+		this.toolbarSet = toolbarSet;
+	}
+
+	/**
+	 * Sets the editor document content
+	 * 
+	 * @param value
+	 *            any HTML string
+	 */
+	public void setValue(String value) {
+		this.value = value;
+	}
+
+	/**
+	 * Sets the dir where the FCKeditor files reside on the server
+	 * 
+	 * @param basePath
+	 *            basePath of the editor instance (e.g. /fckeditor)
+	 */
+	public void setBasePath(String basePath) {
+		this.basePath = basePath;
+	}
+
+	void setConfigParamAll(Map<String, String> map) {
+		fckEditor.getConfig().putAll(map);
+	}
+
+	/**
+	 * Initializes the FCKeditor container and Sets attributes
+	 * 
+	 * @return EVAL_BODY_INCLUDE
+	 */
+	public int doStartTag() throws JspException {
+		fckEditor = new FCKeditor(
+				(HttpServletRequest) pageContext.getRequest(), instanceName,
+				width, height, toolbarSet, value, basePath);
+		fckEditor.setValue(value);
+
+		return EVAL_BODY_INCLUDE;
+	}
+
+	@Override
+	public int doEndTag() throws JspException {
+
+		JspWriter out = pageContext.getOut();
+
+		try {
+			out.println(fckEditor);
+		} catch (IOException ioe) {
+			throw new JspException(
+					"Error: IOException while writing to the user");
+		}
+
+		return EVAL_PAGE;
+	}
+
+}
Index: /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/tool/Compatibility.java
===================================================================
--- /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/tool/Compatibility.java	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/tool/Compatibility.java	(revision 1893)
@@ -0,0 +1,107 @@
+/*
+ * 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.tool;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * Compatibility check.
+ * 
+ * @version $Id$
+ */
+public class Compatibility {
+
+	/**
+	 * Checks, if a browser's user agent string is compatible for the FCKeditor. <br>
+	 * Adapted from: http://dev.fckeditor.net/browser/FCKeditor/releases/stable/fckeditor.php
+	 * 
+	 * @param userAgentString
+	 * @return true, if compatible, otherwise false
+	 */
+	public static boolean check(final String userAgentString) {
+		if (Utils.isEmpty(userAgentString))
+			return false;
+
+		float version;
+
+		// IE 5.5+, check special keys like 'Opera' and 'mac', because there are some
+		// other browsers, containing 'MSIE' in there agent string!
+		if (userAgentString.indexOf("Opera") < 0 && userAgentString.indexOf("mac") < 0) {
+			version = getBrowserVersion(userAgentString, ".*MSIE ([\\d]+.[\\d]+).*");
+			if (version != -1f && version >= 5.5f)
+				return true;
+		}
+
+		// for mozilla only, because all firefox versions are supported
+		version = getBrowserVersion(userAgentString, ".*Gecko/([\\d]+).*");
+		if (version != -1f && version >= 20030210f)
+			return true;
+
+		// Opera 9.5+
+		version = getBrowserVersion(userAgentString, "Opera/([\\d]+.[\\d]+).*");
+		if (version != -1f && version >= 9.5f)
+			return true;
+		version = getBrowserVersion(userAgentString, ".*Opera ([\\d]+.[\\d]+)");
+		if (version != -1f && version >= 9.5f)
+			return true;
+
+		// Safari 3+
+		version = getBrowserVersion(userAgentString, ".*AppleWebKit/([\\d]+).*");
+		if (version != -1f && version >= 522f)
+			return true;
+
+		return false;
+	}
+
+	/**
+	 * Just a wrapper to {@link #check(String)}.
+	 * 
+	 * @param request
+	 */
+	public static boolean isCompatibleBrowser(final HttpServletRequest request) {
+		return (request == null) ? false : check(request.getHeader("user-agent"));
+	}
+
+	/**
+	 * Helper method to get the the browser version from 'userAgent' with the regular expression
+	 * 'regex'. The first group of the matches has to be the version number!
+	 * 
+	 * @param userAgent
+	 * @param regex
+	 * @return The browser version, or -1f, if version con't find out.
+	 */
+	private static float getBrowserVersion(final String userAgent, final String regex) {
+		Pattern pattern = Pattern.compile(regex);
+		Matcher matcher = pattern.matcher(userAgent);
+		if (matcher.matches()) {
+			try {
+				return Float.parseFloat(matcher.group(1));
+			} catch (NumberFormatException e) {
+				return -1f;
+			}
+		}
+		return -1f;
+	}
+
+}
Index: /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/tool/Utils.java
===================================================================
--- /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/tool/Utils.java	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/tool/Utils.java	(revision 1893)
@@ -0,0 +1,129 @@
+/*
+ * 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.tool;
+
+import java.util.HashSet;
+import java.util.Set;
+import java.util.StringTokenizer;
+
+
+
+
+/**
+ * Some static helper methods.
+ * 
+ * @version $Id$
+ */
+public class Utils {
+
+	/**
+	 * Constructs a set of uppercased strings from a 'delimiter' separated
+	 * string.
+	 * 
+	 * @param stringList
+	 * @param delimiter
+	 *            The delimiter. It shouldn't be empty!
+	 * @return An emtpy list, if 'stringList' is empty, or an lowercased set of
+	 *         strings.
+	 * @throws IllegalArgumentException
+	 *             if 'delimiter' is empty.
+	 */
+	public static Set<String> getSet(final String stringList,
+			final String delimiter) {
+		if (isEmpty(delimiter))
+			throw new IllegalArgumentException(
+					"Argument 'delimiter' shouldn't be empty!");
+		if (isEmpty(stringList))
+			return new HashSet<String>();
+
+		Set<String> set = new HashSet<String>();
+		StringTokenizer st = new StringTokenizer(stringList, delimiter);
+		while (st.hasMoreTokens()) {
+			String tmp = st.nextToken();
+			if (isNotEmpty(tmp)) // simple empty filter
+				set.add(tmp.toLowerCase());
+		}
+		return set;
+	}
+
+	/**
+	 * Just a wrapper to {@link #getSet(String, String)} for using '&#124;' as
+	 * delimiter.
+	 */
+	public static Set<String> getSet(final String stringlist) {
+		return getSet(stringlist, "|");
+	}
+
+	/**
+	 * Checks if a string is null or empty.
+	 * 
+	 * @param str
+	 *            to check
+	 * @return <code>true</code> if the String is empty or null
+	 */
+	public static boolean isEmpty(final String str) {
+		return str == null || str.length() == 0;
+	}
+
+	/**
+	 * Just a wrapper to {@link #isEmpty(String)}.
+	 * 
+	 * @param str
+	 * @return <code>true</code> if the String is not empty and not null.
+	 */
+	public static boolean isNotEmpty(final String str) {
+		return !isEmpty(str);
+	}
+
+	/**
+	 * Replaces all 'search' with 'replacement' in 'string'.<br>
+	 * Usage:
+	 * 
+	 * <pre>
+	 * Utils.replaceAll(null, *, *)		= &quot;&quot;
+	 * Utils.replaceAll(&quot;&quot;, *, *)		= &quot;&quot;
+	 * Utils.replaceAll(&quot;foo&quot;, null, *)	= &quot;foo&quot;
+	 * Utils.replaceAll(&quot;foo&quot;, &quot;o&quot;, &quot;a&quot;)	= &quot;faa&quot;
+	 * </pre>
+	 * 
+	 * @param string
+	 * @param search
+	 * @param replacement
+	 * @return replaced String
+	 */
+	public static String replaceAll(final String string, final String search,
+			final String replacement) {
+		if (isEmpty(string))
+			return "";
+		if (isEmpty(search))
+			return string;
+		if (string.indexOf(search) == -1)
+			return string;
+		StringBuffer sb = new StringBuffer(string);
+		int pos = sb.indexOf(search);
+
+		while (pos != -1) {
+			sb.replace(pos, pos + search.length(), replacement);
+			pos = sb.indexOf(search);
+		}
+		return sb.toString();
+	}
+}
Index: /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/tool/UtilsFile.java
===================================================================
--- /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/tool/UtilsFile.java	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/tool/UtilsFile.java	(revision 1893)
@@ -0,0 +1,144 @@
+/*
+ * 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.tool;
+
+import java.io.File;
+import java.io.InputStream;
+
+import org.apache.commons.io.FilenameUtils;
+import org.devlib.schmidt.imageinfo.ImageInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import net.fckeditor.handlers.ConnectorHandler;
+
+/**
+ * Some static helper methods in conjunction with files.
+ *
+ * @version $Id$
+ */
+public class UtilsFile {
+	
+	private static final Logger logger = LoggerFactory.getLogger(UtilsFile.class);
+
+	/**
+     * Do a cleanup of the file name to avoid possible problems. <br>
+     * The force single Extension property will be respected!
+     * 
+     * @param fileName
+     * @return folder name where \ / | : ? * &quot; &lt; &gt; 'control chars' replaced by '_'
+     */
+    public static String sanitizeFileName(final String fileName) {
+    	if (fileName == null)
+    		return null;
+    	if (fileName.equals(""))
+    		return "";
+    
+    	String name = (ConnectorHandler.isForceSingleExtension()) ? UtilsFile.forceSingleExtension(fileName)
+    	        : fileName;
+    
+    	// Remove \ / | : ? * " < > with _
+    	return name.replaceAll("\\/|\\/|\\||:|\\?|\\*|\"|<|>|\\p{Cntrl}", "_");
+    }
+
+	/**
+     * Do a cleanup of the folder name to avoid possible problems.
+     * 
+     * @param folderName
+     * @return folder name where . \ / | : ? * &quot; &lt; &gt; 'control chars' replaced by '_'
+     */
+    public static String sanitizeFolderName(final String folderName) {
+    	if (folderName == null)
+    		return null;
+    	if (folderName.equals(""))
+    		return "";
+    
+    	// Remove . \ / | : ? * " < > with _
+    	return folderName.replaceAll("\\.|\\/|\\/|\\||:|\\?|\\*|\"|<|>|\\p{Cntrl}", "_");
+    }
+
+	/**
+	 * Checks if the underlying file of the InputStrem is an image.
+	 * 
+	 * @param in
+	 * @return <code>True</code>, if the underlying file is an image, or <code>false</code>.
+	 */
+	public static boolean isImage(final InputStream in) {
+    	ImageInfo ii = new ImageInfo();
+    	ii.setInput(in);
+    	return ii.check();
+    }
+
+	/**
+     * TODO - document me!
+     * 
+     * @param path
+     * @return <code>true</code> if path corresponds to rules or
+     *         <code>false</code>.
+     */
+    public static boolean isValidPath(final String path) {
+    	if (Utils.isEmpty(path))
+    		return false;
+    	if (!path.startsWith("/"))
+    		return false;
+    	if (!path.endsWith("/"))
+    		return false;
+    	
+    	if (!path.equals(FilenameUtils.separatorsToUnix(FilenameUtils
+    			.normalize(path))))
+    		return false;
+    	
+    	return true;
+    }
+
+	/**
+     * TODO - document me!
+     * 
+     * @param filename
+     * @return string with a single dot only
+     */
+    public static String forceSingleExtension(final String filename) {
+    	return filename.replaceAll("\\.(?![^.]+$)", "_");
+    }
+
+	/**
+     * TODO - document me!
+     * 
+     * @param filename
+     * @return <code>true</code> if filename contains severals dots else
+     *         <code>false</code>
+     */
+    public static boolean isSingleExtension(final String filename) {
+    	return filename.matches("[^\\.]+\\.[^\\.]+");
+    }
+    
+    /**
+	 * TODO - document me!
+	 * @param dir
+	 */
+	public static void checkDirAndCreate(File dir) {
+		if (!dir.exists()) {
+			dir.mkdirs();
+			logger.debug("Dir '{}' successfully created", dir);
+		}
+	}
+
+}
Index: /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/tool/UtilsResponse.java
===================================================================
--- /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/tool/UtilsResponse.java	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/tool/UtilsResponse.java	(revision 1893)
@@ -0,0 +1,85 @@
+/*
+ * 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.tool;
+
+import javax.servlet.http.HttpServletRequest;
+
+import net.fckeditor.handlers.ConnectorHandler;
+import net.fckeditor.handlers.ResourceTypeHandler;
+
+/**
+ * Some static helper methods in conjunction with the servlet response.
+ *
+ * @version $Id$
+ */
+public class UtilsResponse {
+
+	/**
+	 * TODO - document me!
+     * 
+     * @param request
+     * @param resourceType
+     * @param urlPath TODO
+     * @param prependContextPath
+     * @param fullUrl
+     * @return constructed url
+     */
+    public static String constructResponseUrl(HttpServletRequest request,
+    		ResourceTypeHandler resourceType, String urlPath,
+    		boolean prependContextPath, boolean fullUrl) {
+    		
+    	StringBuffer sb = new StringBuffer();
+    	
+    	if (fullUrl) {
+    		String address = request.getRequestURL().toString();
+    		sb.append(address.substring(0, address.indexOf('/', 8))
+    				+ request.getContextPath());
+    	}
+    	
+    	if (prependContextPath && !fullUrl)
+    		sb.append(request.getContextPath());
+    	
+    	sb.append(ConnectorHandler.getUserFilesPath(request));
+    	sb.append(resourceType.getPath());
+    	
+    	if (Utils.isNotEmpty(urlPath))
+    		sb.append(urlPath);
+    	
+    	return sb.toString();
+    }
+
+	/**
+	 * TODO - document me!
+	 * 
+	 * @param request
+	 * @param resourceType
+	 * @param prependContextPath
+	 * @param fullUrl
+	 * @return constructed url
+	 */
+	public static String constructResponseUrl(HttpServletRequest request,
+    		ResourceTypeHandler resourceType, boolean prependContextPath, 
+    		boolean fullUrl) {
+    	return constructResponseUrl(request, resourceType, null, 
+    			prependContextPath, fullUrl);
+    }
+
+}
Index: /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/tool/XHtmlTagTool.java
===================================================================
--- /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/tool/XHtmlTagTool.java	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-core/src/main/java/net/fckeditor/tool/XHtmlTagTool.java	(revision 1893)
@@ -0,0 +1,135 @@
+/*
+ * 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.tool;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Tool to construct a XHTML-tag.<br>
+ * <br>
+ * Usage:
+ * <pre>
+ * XHtmlTagTool tag = XHtmlTagTool(&quot;a&quot;, &quot;link&quot;);
+ * tag.addAttribute(&quot;href&quot;, &quot;http://google.com&quot;);
+ * tag.toString();	: &lt;a href=&quot;http://google.com&quot;&gt;link&lt;/a&gt;
+ * </pre>
+ * 
+ * Hint:
+ * <ul>
+ * <li>Attributes are not ordered.</li>
+ * <li>If your tag shouldn't have a value but the tag has to close with '&lt;/[tagname]&gt;', set
+ * the value to {@link XHtmlTagTool#SPACE}.</li>
+ * </ul>
+ * 
+ * @version $Id$
+ */
+public class XHtmlTagTool {
+
+	/** Name of the tag. */
+	private String name;
+
+	/** Container for the attributes. */
+	private Map<String, String> attributes = new HashMap<String, String>();
+
+	/** Value of the tag. */
+	private String value = null;
+	
+	/** Indicator to uses non self-closing tag. */
+	public static final String SPACE = " ";
+
+	public XHtmlTagTool(final String name, final String value) throws IllegalArgumentException {
+		if (Utils.isEmpty(name))
+			throw new IllegalArgumentException("Parameter 'name' shouldn't be empty!");
+		this.name = name;
+		this.value = value;
+	}
+
+	public XHtmlTagTool(final String name) {
+		this(name, null);
+	}
+
+	/**
+	 * Setter for the value of the tag.
+	 * 
+	 * @param value
+	 */
+	public void setValue(final String value) {
+		this.value = value;
+	}
+
+	/**
+	 * Adds an attribute to the tag.
+	 * 
+	 * @param key
+	 * @param value
+	 * @throws IllegalArgumentException if 'key' is empty.
+	 */
+	public void addAttribute(final String key, final String value) {
+		if (Utils.isEmpty(key))
+			throw new IllegalArgumentException("Parameter 'key' shouldn't be empty!");
+		attributes.put(key, value);
+	}
+
+	/**
+	 * Constructs the tag.
+	 * 
+	 * @see java.lang.Object#toString()
+	 */
+	@Override
+	public String toString() {
+		StringBuffer tag = new StringBuffer();
+
+		// open tag
+		tag.append("<").append(name);
+
+		// add attributes
+		for (String key : attributes.keySet()) {
+			String val = attributes.get(key);
+			tag.append(' ').append(key).append('=').append('\"').append(val).append('\"');
+		}
+
+		// close the tag
+		if (Utils.isNotEmpty(value)) {
+			tag.append(">").append(value).append("</").append(name).append('>');
+		} else
+			tag.append(" />");
+
+		return tag.toString();
+	}
+
+	@Override
+	public boolean equals(Object obj) {
+		try {
+			XHtmlTagTool tag = (XHtmlTagTool) obj;
+			return value.equals(tag.value) && name.equals(tag.name)
+					&& attributes.equals(tag.attributes);
+		} catch (ClassCastException e) {
+			return false;
+		}
+	}
+	
+	@Override
+	public int hashCode() {
+		
+		return name.hashCode() + value.hashCode() + attributes.hashCode();
+	}
+}
Index: /FCKeditor.Java/branches/2.4/java-core/src/main/java/org/devlib/schmidt/imageinfo/ImageInfo.java
===================================================================
--- /FCKeditor.Java/branches/2.4/java-core/src/main/java/org/devlib/schmidt/imageinfo/ImageInfo.java	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-core/src/main/java/org/devlib/schmidt/imageinfo/ImageInfo.java	(revision 1893)
@@ -0,0 +1,1231 @@
+/*
+ * ImageInfo.java
+ *
+ * Version 1.9
+ *
+ * A Java class to determine image width, height and color depth for
+ * a number of image file formats.
+ *
+ * Written by Marco Schmidt 
+ *
+ * Contributed to the Public Domain.
+ */
+package org.devlib.schmidt.imageinfo;
+
+import java.io.DataInput;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.io.IOException;
+import java.net.URL;
+import java.util.Vector;
+
+/**
+ * Get file format, image resolution, number of bits per pixel and optionally 
+ * number of images, comments and physical resolution from 
+ * JPEG, GIF, BMP, PCX, PNG, IFF, RAS, PBM, PGM, PPM and PSD files 
+ * (or input streams).
+ * <p>
+ * Use the class like this:
+ * <pre>
+ * ImageInfo ii = new ImageInfo();
+ * ii.setInput(in); // in can be InputStream or RandomAccessFile
+ * ii.setDetermineImageNumber(true); // default is false
+ * ii.setCollectComments(true); // default is false
+ * if (!ii.check()) {
+ *   System.err.println("Not a supported image file format.");
+ *   return;
+ * }
+ * System.out.println(ii.getFormatName() + ", " + ii.getMimeType() + 
+ *   ", " + ii.getWidth() + " x " + ii.getHeight() + " pixels, " + 
+ *   ii.getBitsPerPixel() + " bits per pixel, " + ii.getNumberOfImages() +
+ *   " image(s), " + ii.getNumberOfComments() + " comment(s).");
+ *  // there are other properties, check out the API documentation
+ * </pre>
+ * You can also use this class as a command line program.
+ * Call it with a number of image file names and URLs as parameters:
+ * <pre>
+ *   java ImageInfo *.jpg *.png *.gif http://somesite.tld/image.jpg
+ * </pre>
+ * or call it without parameters and pipe data to it:
+ * <pre>
+ *   java ImageInfo &lt; image.jpg  
+ * </pre>
+ * <p>
+ * Known limitations:
+ * <ul>
+ * <li>When the determination of the number of images is turned off, GIF bits 
+ *  per pixel are only read from the global header.
+ *  For some GIFs, local palettes change this to a typically larger
+ *  value. To be certain to get the correct color depth, call
+ *  setDetermineImageNumber(true) before calling check().
+ *  The complete scan over the GIF file will take additional time.</li>
+ * <li>Transparency information is not included in the bits per pixel count.
+ *  Actually, it was my decision not to include those bits, so it's a feature! ;-)</li>
+ * </ul>
+ * <p>
+ * Requirements:
+ * <ul>
+ * <li>Java 1.1 or higher</li>
+ * </ul>
+ * <p>
+ * The latest version can be found at <a href="http://schmidt.devlib.org/image-info/">http://schmidt.devlib.org/image-info/</a>.
+ * <p>
+ * Written by Marco Schmidt.
+ * <p>
+ * This class is contributed to the Public Domain.
+ * Use it at your own risk.
+ * <p>
+ * <a name="history">History</a>:
+ * <ul>
+ * <li><strong>2001-08-24</strong> Initial version.</li>
+ * <li><strong>2001-10-13</strong> Added support for the file formats BMP and PCX.</li>
+ * <li><strong>2001-10-16</strong> Fixed bug in read(int[], int, int) that returned
+ * <li><strong>2002-01-22</strong> Added support for file formats Amiga IFF and Sun Raster (RAS).</li>
+ * <li><strong>2002-01-24</strong> Added support for file formats Portable Bitmap / Graymap / Pixmap (PBM, PGM, PPM) and Adobe Photoshop (PSD).
+ *   Added new method getMimeType() to return the MIME type associated with a particular file format.</li>
+ * <li><strong>2002-03-15</strong> Added support to recognize number of images in file. Only works with GIF.
+ *   Use {@link #setDetermineImageNumber} with <code>true</code> as argument to identify animated GIFs
+ *   ({@link #getNumberOfImages()} will return a value larger than <code>1</code>).</li>
+ * <li><strong>2002-04-10</strong> Fixed a bug in the feature 'determine number of images in animated GIF' introduced with version 1.1.
+ *   Thanks to Marcelo P. Lima for sending in the bug report. 
+ *   Released as 1.1.1.</li>
+ * <li><strong>2002-04-18</strong> Added {@link #setCollectComments(boolean)}. 
+ *  That new method lets the user specify whether textual comments are to be  
+ *  stored in an internal list when encountered in an input image file / stream.
+ *  Added two methods to return the physical width and height of the image in dpi: 
+ *   {@link #getPhysicalWidthDpi()} and {@link #getPhysicalHeightDpi()}.
+ *  If the physical resolution could not be retrieved, these methods return <code>-1</code>.
+ *  </li>
+ * <li><strong>2002-04-23</strong> Added support for the new properties physical resolution and
+ *   comments for some formats. Released as 1.2.</li>
+ * <li><strong>2002-06-17</strong> Added support for SWF, sent in by Michael Aird.
+ *  Changed checkJpeg() so that other APP markers than APP0 will not lead to a failure anymore.
+ *  Released as 1.3.</li>
+ * <li><strong>2003-07-28</strong> Bug fix - skip method now takes return values into consideration.
+ *  Less bytes than necessary may have been skipped, leading to flaws in the retrieved information in some cases.
+ *  Thanks to Bernard Bernstein for pointing that out.
+ *  Released as 1.4.</li>
+ * <li><strong>2004-02-29</strong> Added support for recognizing progressive JPEG and
+ *  interlaced PNG and GIF. A new method {@link #isProgressive()} returns whether ImageInfo
+ *  has found that the storage type is progressive (or interlaced). 
+ *  Thanks to Joe Germuska for suggesting the feature.
+ *  Bug fix: BMP physical resolution is now correctly determined.
+ *  Released as 1.5.</li>
+ * <li><strong>2004-11-30</strong> Bug fix: recognizing progressive GIFs 
+ * (interlaced in GIF terminology) did not work (thanks to Franz Jeitler for 
+ *   pointing this out). Now it should work, but only if the number of images is determined.
+ *  This is because information on interlacing is stored in a local image header.
+ *  In theory, different images could be stored interlaced and non-interlaced in one 
+ *  file. However, I think  that's unlikely. Right now, the last image in the GIF file 
+ *  that is examined by ImageInfo is used for the "progressive" status.</li>
+ * <li><strong>2005-01-02</strong> Some code clean up (unused methods and variables
+ *  commented out, missing javadoc comments, etc.). Thanks to George Sexton for a long list.
+ *  Removed usage of Boolean.toString because
+ *  it's a Java 1.4+ feature (thanks to Gregor Dupont).
+ *  Changed delimiter character in compact output from semicolon to tabulator
+ * (for better integration with cut(1) and other Unix tools).
+ *  Added some points to the <a href="http://schmidt.devlib.org/image-info/index.html#knownissues">'Known
+ *  issues' section of the website</a>. 
+ *  Released as 1.6.</li>
+ * <li><strong>2005-07-26</strong> Removed code to identify Flash (SWF) files.
+ *  Has repeatedly led to problems and support requests, and I don't know the
+ *  format and don't have the time and interest to fix it myself.
+ *  I repeatedly included fixes by others which didn't work for some people.
+ *  I give up on SWF. Please do not contact me about it anymore.
+ *  Set package of ImageInfo class to org.devlib.schmidt.imageinfo (a package
+ *  was repeatedly requested by some users).
+ *  Released as 1.7.</li>
+ *  <li><strong>2006-02-23</strong> Removed Flash helper methods which weren't used elsewhere.
+ *   Updated skip method which tries "read" whenever "skip(Bytes)" returns a result of 0.
+ *   The old method didn't work with certain input stream types on truncated data streams.
+ *   Thanks to Martin Leidig for reporting this and sending in code.
+ *   Released as 1.8.</li>
+ *  </li>
+ *  <li><strong>2006-11-13</strong> Removed check that made ImageInfo report JPEG APPx
+ *   markers smaller than 14 bytes as files in unknown format. Such JPEGs seem to be
+ *   generated by Google's Picasa application. First reported with fix by 
+ *   Karl von Randow. Released as 1.9.</li>  
+ * </ul>
+ * @author Marco Schmidt
+ */
+public class ImageInfo {
+	/**
+	 * Return value of {@link #getFormat()} for JPEG streams.
+	 * ImageInfo can extract physical resolution and comments
+	 * from JPEGs (only from APP0 headers).
+	 * Only one image can be stored in a file.
+	 * It is determined whether the JPEG stream is progressive 
+	 * (see {@link #isProgressive()}).
+	 */
+	public static final int FORMAT_JPEG = 0;
+
+	/**
+	 * Return value of {@link #getFormat()} for GIF streams.
+	 * ImageInfo can extract comments from GIFs and count the number
+	 * of images (GIFs with more than one image are animations).
+	 * It is determined whether the GIF stream is interlaced (see {@link #isProgressive()}).
+	 */
+	public static final int FORMAT_GIF = 1;
+
+	/**
+	 * Return value of {@link #getFormat()} for PNG streams.
+	 * PNG only supports one image per file.
+	 * Both physical resolution and comments can be stored with PNG,
+	 * but ImageInfo is currently not able to extract those.
+	 * It is determined whether the PNG stream is interlaced (see {@link #isProgressive()}).
+	 */
+	public static final int FORMAT_PNG = 2;
+
+	/**
+	 * Return value of {@link #getFormat()} for BMP streams.
+	 * BMP only supports one image per file.
+	 * BMP does not allow for comments.
+	 * The physical resolution can be stored.
+	 */
+	public static final int FORMAT_BMP = 3;
+
+	/**
+	 * Return value of {@link #getFormat()} for PCX streams.
+	 * PCX does not allow for comments or more than one image per file.
+	 * However, the physical resolution can be stored.
+	 */
+	public static final int FORMAT_PCX = 4;
+
+	/**
+	 * Return value of {@link #getFormat()} for IFF streams.
+	 */
+	public static final int FORMAT_IFF = 5;
+
+	/**
+	 * Return value of {@link #getFormat()} for RAS streams.
+	 * Sun Raster allows for one image per file only and is not able to
+	 * store physical resolution or comments.
+	 */
+	public static final int FORMAT_RAS = 6;
+
+	/** Return value of {@link #getFormat()} for PBM streams. */
+	public static final int FORMAT_PBM = 7;
+
+	/** Return value of {@link #getFormat()} for PGM streams. */
+	public static final int FORMAT_PGM = 8;
+
+	/** Return value of {@link #getFormat()} for PPM streams. */
+	public static final int FORMAT_PPM = 9;
+
+	/** Return value of {@link #getFormat()} for PSD streams. */
+	public static final int FORMAT_PSD = 10;
+
+/*	public static final int COLOR_TYPE_UNKNOWN = -1;
+	public static final int COLOR_TYPE_TRUECOLOR_RGB = 0;
+	public static final int COLOR_TYPE_PALETTED = 1;
+	public static final int COLOR_TYPE_GRAYSCALE= 2;
+	public static final int COLOR_TYPE_BLACK_AND_WHITE = 3;*/
+
+	/**
+	 * The names of all supported file formats.
+	 * The FORMAT_xyz int constants can be used as index values for
+	 * this array.
+	 */
+	private static final String[] FORMAT_NAMES =
+		{"JPEG", "GIF", "PNG", "BMP", "PCX", 
+		 "IFF", "RAS", "PBM", "PGM", "PPM", 
+		 "PSD"};
+
+	/**
+	 * The names of the MIME types for all supported file formats.
+	 * The FORMAT_xyz int constants can be used as index values for
+	 * this array.
+	 */
+	private static final String[] MIME_TYPE_STRINGS =
+		{"image/jpeg", "image/gif", "image/png", "image/bmp", "image/pcx", 
+		 "image/iff", "image/ras", "image/x-portable-bitmap", "image/x-portable-graymap", "image/x-portable-pixmap", 
+		 "image/psd"};
+
+	private int width;
+	private int height;
+	private int bitsPerPixel;
+	//private int colorType = COLOR_TYPE_UNKNOWN;
+	private boolean progressive;
+	private int format;
+	private InputStream in;
+	private DataInput din;
+	private boolean collectComments = true;
+	private Vector comments;
+	private boolean determineNumberOfImages;
+	private int numberOfImages;
+	private int physicalHeightDpi;
+	private int physicalWidthDpi;
+
+	private void addComment(String s) {
+		if (comments == null) {
+			comments = new Vector();
+		}
+		comments.addElement(s);
+	}
+
+	/**
+	 * Call this method after you have provided an input stream or file
+	 * using {@link #setInput(InputStream)} or {@link #setInput(DataInput)}.
+	 * If true is returned, the file format was known and information
+	 * on the file's content can be retrieved using the various getXyz methods.
+	 * @return if information could be retrieved from input
+	 */
+	public boolean check() {
+		format = -1;
+		width = -1;
+		height = -1;
+		bitsPerPixel = -1;
+		numberOfImages = 1;
+		physicalHeightDpi = -1;
+		physicalWidthDpi = -1;
+		comments = null;
+		try {
+			int b1 = read() & 0xff;
+			int b2 = read() & 0xff;
+			if (b1 == 0x47 && b2 == 0x49) {
+				return checkGif();
+			}
+			else
+			if (b1 == 0x89 && b2 == 0x50) {
+				return checkPng();
+			}
+			else
+			if (b1 == 0xff && b2 == 0xd8) {
+				return checkJpeg();
+			}
+			else
+			if (b1 == 0x42 && b2 == 0x4d) {
+				return checkBmp();
+			}
+			else
+			if (b1 == 0x0a && b2 < 0x06) {
+				return checkPcx();
+			}
+			else
+			if (b1 == 0x46 && b2 == 0x4f) {
+				return checkIff();
+			}
+			else
+			if (b1 == 0x59 && b2 == 0xa6) {
+				return checkRas();
+			}
+			else
+			if (b1 == 0x50 && b2 >= 0x31 && b2 <= 0x36) {
+				return checkPnm(b2 - '0');
+			}
+			else
+			if (b1 == 0x38 && b2 == 0x42) {
+				return checkPsd();
+			}
+			else {
+				return false;
+			}
+		} catch (IOException ioe) {
+			return false;
+		}
+	}
+
+	private boolean checkBmp() throws IOException {
+		byte[] a = new byte[44];
+		if (read(a) != a.length) {
+			return false;
+		}
+		width = getIntLittleEndian(a, 16);
+		height = getIntLittleEndian(a, 20);
+		if (width < 1 || height < 1) {
+			return false;
+		}
+		bitsPerPixel = getShortLittleEndian(a, 26);
+		if (bitsPerPixel != 1 && bitsPerPixel != 4 &&
+		    bitsPerPixel != 8 && bitsPerPixel != 16 &&
+		    bitsPerPixel != 24 && bitsPerPixel != 32) {
+		    return false;
+		}
+		int x = (int)(getIntLittleEndian(a, 36) * 0.0254);
+		if (x > 0) {
+			setPhysicalWidthDpi(x);
+		}
+		int y = (int)(getIntLittleEndian(a, 40) * 0.0254);
+		if (y > 0) {
+			setPhysicalHeightDpi(y);
+		}
+		format = FORMAT_BMP;
+		return true;
+	}
+
+	private boolean checkGif() throws IOException {
+		final byte[] GIF_MAGIC_87A = {0x46, 0x38, 0x37, 0x61};
+		final byte[] GIF_MAGIC_89A = {0x46, 0x38, 0x39, 0x61};
+		byte[] a = new byte[11]; // 4 from the GIF signature + 7 from the global header
+		if (read(a) != 11) {
+			return false;
+		}
+		if ((!equals(a, 0, GIF_MAGIC_89A, 0, 4)) &&
+			(!equals(a, 0, GIF_MAGIC_87A, 0, 4))) {
+			return false;
+		}
+		format = FORMAT_GIF;
+		width = getShortLittleEndian(a, 4);
+		height = getShortLittleEndian(a, 6);
+		int flags = a[8] & 0xff;
+		bitsPerPixel = ((flags >> 4) & 0x07) + 1;
+		//progressive = (flags & 0x02) != 0;
+		if (!determineNumberOfImages) {
+			return true;
+		}
+		// skip global color palette
+		if ((flags & 0x80) != 0) {
+			int tableSize = (1 << ((flags & 7) + 1)) * 3;
+			skip(tableSize);
+		}
+		numberOfImages = 0;
+		int blockType;
+		do
+		{
+			blockType = read();
+			switch(blockType)
+			{
+				case(0x2c): // image separator
+				{
+					if (read(a, 0, 9) != 9) {
+						return false;
+					}
+					flags = a[8] & 0xff;
+					progressive = (flags & 0x40) != 0;
+					/*int locWidth = getShortLittleEndian(a, 4);
+					int locHeight = getShortLittleEndian(a, 6);
+					System.out.println("LOCAL: " + locWidth + " x " + locHeight);*/
+					int localBitsPerPixel = (flags & 0x07) + 1;
+					if (localBitsPerPixel > bitsPerPixel) {
+						bitsPerPixel = localBitsPerPixel;
+					}
+					if ((flags & 0x80) != 0) {
+						skip((1 << localBitsPerPixel) * 3);
+					}
+					skip(1); // initial code length
+					int n;
+					do
+					{
+						n = read();
+						if (n > 0) {
+							skip(n);
+						}
+						else
+						if (n == -1) {
+							return false;
+						}
+					}
+					while (n > 0);
+					numberOfImages++;
+					break;
+				}
+				case(0x21): // extension
+				{
+					int extensionType = read();
+					if (collectComments && extensionType == 0xfe) {
+						StringBuffer sb = new StringBuffer();
+						int n;
+						do
+						{
+							n = read();
+							if (n == -1) {
+								return false;
+							}
+							if (n > 0) {
+								for (int i = 0; i < n; i++) {
+									int ch = read();
+									if (ch == -1) {
+										return false;
+									}
+									sb.append((char)ch);
+								}
+							}
+						}
+						while (n > 0);
+					} else {
+						int n;
+						do
+						{
+							n = read();
+							if (n > 0) {
+								skip(n);
+							}
+							else
+							if (n == -1) {
+								return false;
+							}
+						}
+						while (n > 0);
+					}
+					break;
+				}
+				case(0x3b): // end of file
+				{
+					break;
+				}
+				default:
+				{
+					return false;
+				}
+			}
+		}
+		while (blockType != 0x3b);
+		return true;
+	}
+
+	private boolean checkIff() throws IOException {
+		byte[] a = new byte[10];
+		// read remaining 2 bytes of file id, 4 bytes file size 
+		// and 4 bytes IFF subformat
+		if (read(a, 0, 10) != 10) {
+			return false;
+		}
+		final byte[] IFF_RM = {0x52, 0x4d};
+		if (!equals(a, 0, IFF_RM, 0, 2)) {
+			return false;
+		}
+		int type = getIntBigEndian(a, 6);
+		if (type != 0x494c424d && // type must be ILBM...
+		    type != 0x50424d20) { // ...or PBM
+		    return false;
+		}
+		// loop chunks to find BMHD chunk
+		do {
+			if (read(a, 0, 8) != 8) {
+				return false;
+			}
+			int chunkId = getIntBigEndian(a, 0);
+			int size = getIntBigEndian(a, 4);
+			if ((size & 1) == 1) {
+				size++;
+			}
+			if (chunkId == 0x424d4844) { // BMHD chunk
+				if (read(a, 0, 9) != 9) {
+					return false;
+				}
+				format = FORMAT_IFF;
+				width = getShortBigEndian(a, 0);
+				height = getShortBigEndian(a, 2);
+				bitsPerPixel = a[8] & 0xff;
+				return (width > 0 && height > 0 && bitsPerPixel > 0 && bitsPerPixel < 33);
+			} else {
+				skip(size);
+			}
+		} while (true);
+	}
+
+	private boolean checkJpeg() throws IOException {
+		byte[] data = new byte[12];
+		while (true) {
+			if (read(data, 0, 4) != 4) {
+				return false;
+			}
+			int marker = getShortBigEndian(data, 0);
+			int size = getShortBigEndian(data, 2);
+			if ((marker & 0xff00) != 0xff00) {
+				return false; // not a valid marker
+			}
+			if (marker == 0xffe0) { // APPx 
+				if (size < 14) {
+					// not an APPx header as we know it, skip
+					skip(size - 2);
+					continue;
+				}
+				if (read(data, 0, 12) != 12) {
+					return false;
+				}
+				final byte[] APP0_ID = {0x4a, 0x46, 0x49, 0x46, 0x00};
+				if (equals(APP0_ID, 0, data, 0, 5)) {
+					//System.out.println("data 7=" + data[7]);
+					if (data[7] == 1) {
+						setPhysicalWidthDpi(getShortBigEndian(data, 8));
+						setPhysicalHeightDpi(getShortBigEndian(data, 10));
+					}
+					else
+					if (data[7] == 2) {
+						int x = getShortBigEndian(data, 8);
+						int y = getShortBigEndian(data, 10);
+						setPhysicalWidthDpi((int)(x * 2.54f));
+						setPhysicalHeightDpi((int)(y * 2.54f));
+					}
+				}
+				skip(size - 14);
+			}
+			else
+			if (collectComments && size > 2 && marker == 0xfffe) { // comment
+				size -= 2;
+				byte[] chars = new byte[size];
+				if (read(chars, 0, size) != size) {
+					return false;
+				}
+				String comment = new String(chars, "iso-8859-1");
+				comment = comment.trim();
+				addComment(comment);
+			}
+			else
+			if (marker >= 0xffc0 && marker <= 0xffcf && marker != 0xffc4 && marker != 0xffc8) {
+				if (read(data, 0, 6) != 6) {
+					return false;
+				}
+				format = FORMAT_JPEG;
+				bitsPerPixel = (data[0] & 0xff) * (data[5] & 0xff);
+				progressive = marker == 0xffc2 || marker == 0xffc6 ||
+					marker == 0xffca || marker == 0xffce;
+				width = getShortBigEndian(data, 3);
+				height = getShortBigEndian(data, 1);
+				return true;
+			} else {
+				skip(size - 2);
+			}
+		}
+	}
+
+	private boolean checkPcx() throws IOException {
+		byte[] a = new byte[64];
+		if (read(a) != a.length) {
+			return false;
+		}
+		if (a[0] != 1) { // encoding, 1=RLE is only valid value
+			return false;
+		}
+		// width / height
+		int x1 = getShortLittleEndian(a, 2);
+		int y1 = getShortLittleEndian(a, 4);
+		int x2 = getShortLittleEndian(a, 6);
+		int y2 = getShortLittleEndian(a, 8);
+		if (x1 < 0 || x2 < x1 || y1 < 0 || y2 < y1) {
+			return false;
+		}
+		width = x2 - x1 + 1;
+		height = y2 - y1 + 1;
+		// color depth
+		int bits = a[1];
+		int planes = a[63];
+		if (planes == 1 &&
+		    (bits == 1 || bits == 2 || bits == 4 || bits == 8)) {
+			// paletted
+			bitsPerPixel = bits;
+		} else
+		if (planes == 3 && bits == 8) {
+			// RGB truecolor
+			bitsPerPixel = 24;
+		} else {
+			return false;
+		}
+		setPhysicalWidthDpi(getShortLittleEndian(a, 10));
+		setPhysicalHeightDpi(getShortLittleEndian(a, 10));
+		format = FORMAT_PCX;
+		return true;
+	}
+
+	private boolean checkPng() throws IOException {
+		final byte[] PNG_MAGIC = {0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a};
+		byte[] a = new byte[27];
+		if (read(a) != 27) {
+			return false;
+		}
+		if (!equals(a, 0, PNG_MAGIC, 0, 6)) {
+			return false;
+		}
+		format = FORMAT_PNG;
+		width = getIntBigEndian(a, 14);
+		height = getIntBigEndian(a, 18);
+		bitsPerPixel = a[22] & 0xff;
+		int colorType = a[23] & 0xff;
+		if (colorType == 2 || colorType == 6) {
+			bitsPerPixel *= 3;
+		}
+		progressive = (a[26] & 0xff) != 0;
+		return true;
+	}
+
+	private boolean checkPnm(int id) throws IOException {
+		if (id < 1 || id > 6) {
+			return false;
+		}
+		final int[] PNM_FORMATS = {FORMAT_PBM, FORMAT_PGM, FORMAT_PPM};
+		format = PNM_FORMATS[(id - 1) % 3];
+		boolean hasPixelResolution = false;
+		String s;
+		while (true)
+		{
+			s = readLine();
+			if (s != null) {
+				s = s.trim();
+			}
+			if (s == null || s.length() < 1) {
+				continue;
+			}
+			if (s.charAt(0) == '#') { // comment
+				if (collectComments && s.length() > 1) {
+					addComment(s.substring(1));
+				}
+				continue;
+			}
+			if (!hasPixelResolution) { // split "343 966" into width=343, height=966
+				int spaceIndex = s.indexOf(' ');
+				if (spaceIndex == -1) {
+					return false;
+				}
+				String widthString = s.substring(0, spaceIndex);
+				spaceIndex = s.lastIndexOf(' ');
+				if (spaceIndex == -1) {
+					return false;
+				}
+				String heightString = s.substring(spaceIndex + 1);
+				try {
+					width = Integer.parseInt(widthString);
+					height = Integer.parseInt(heightString);
+				} catch (NumberFormatException nfe) {
+					return false;
+				}
+				if (width < 1 || height < 1) {
+					return false;
+				}
+				if (format == FORMAT_PBM) {
+					bitsPerPixel = 1;
+					return true;
+				}
+				hasPixelResolution = true;
+			}
+			else
+			{
+				int maxSample;
+				try {
+					maxSample = Integer.parseInt(s);
+				} catch (NumberFormatException nfe) {
+					return false;
+				}
+				if (maxSample < 0) {
+					return false;
+				}
+				for (int i = 0; i < 25; i++) {
+					if (maxSample < (1 << (i + 1))) {
+						bitsPerPixel = i + 1;
+						if (format == FORMAT_PPM) {
+							bitsPerPixel *= 3;
+						}
+						return true;
+					}
+				}
+				return false;
+			}
+		}
+	}
+
+	private boolean checkPsd() throws IOException {
+		byte[] a = new byte[24];
+		if (read(a) != a.length) {
+			return false;
+		}
+		final byte[] PSD_MAGIC = {0x50, 0x53};
+		if (!equals(a, 0, PSD_MAGIC, 0, 2)) {
+			return false;
+		}
+		format = FORMAT_PSD;
+		width = getIntBigEndian(a, 16);
+		height = getIntBigEndian(a, 12);
+		int channels = getShortBigEndian(a, 10);
+		int depth = getShortBigEndian(a, 20);
+		bitsPerPixel = channels * depth;
+		return (width > 0 && height > 0 && bitsPerPixel > 0 && bitsPerPixel <= 64);
+	}
+
+	private boolean checkRas() throws IOException {
+		byte[] a = new byte[14];
+		if (read(a) != a.length) {
+			return false;
+		}
+		final byte[] RAS_MAGIC = {0x6a, (byte)0x95};
+		if (!equals(a, 0, RAS_MAGIC, 0, 2)) {
+			return false;
+		}
+		format = FORMAT_RAS;
+		width = getIntBigEndian(a, 2);
+		height = getIntBigEndian(a, 6);
+		bitsPerPixel = getIntBigEndian(a, 10);
+		return (width > 0 && height > 0 && bitsPerPixel > 0 && bitsPerPixel <= 24);
+	}
+
+	/**
+	 * Run over String list, return false iff at least one of the arguments
+	 * equals <code>-c</code>.
+	 * @param args string list to check
+	 */
+	private static boolean determineVerbosity(String[] args) {
+		if (args != null && args.length > 0) {
+			for (int i = 0; i < args.length; i++) {
+				if ("-c".equals(args[i])) {
+					return false;
+				}
+			}
+		}
+		return true;
+	}
+
+	private static boolean equals(byte[] a1, int offs1, byte[] a2, int offs2, int num) {
+		while (num-- > 0) {
+			if (a1[offs1++] != a2[offs2++]) {
+				return false;
+			}
+		}
+		return true;
+	}
+
+	/** 
+	 * If {@link #check()} was successful, returns the image's number of bits per pixel.
+	 * Does not include transparency information like the alpha channel.
+	 * @return number of bits per image pixel
+	 */
+	public int getBitsPerPixel() {
+		return bitsPerPixel;
+	}
+
+	/**
+	 * Returns the index'th comment retrieved from the file.
+	 * @param index int index of comment to return
+	 * @throws IllegalArgumentException if index is smaller than 0 or larger than or equal
+	 * to the number of comments retrieved
+	 * @see #getNumberOfComments
+	 */
+	public String getComment(int index) {
+		if (comments == null || index < 0 || index >= comments.size()) {
+			throw new IllegalArgumentException("Not a valid comment index: " + index);
+		}
+		return (String)comments.elementAt(index);
+	}
+
+	/**
+	 * If {@link #check()} was successful, returns the image format as one
+	 * of the FORMAT_xyz constants from this class.
+	 * Use {@link #getFormatName()} to get a textual description of the file format.
+	 * @return file format as a FORMAT_xyz constant
+	 */
+	public int getFormat() {
+		return format;
+	}
+
+	/**
+	 * If {@link #check()} was successful, returns the image format's name.
+	 * Use {@link #getFormat()} to get a unique number.
+	 * @return file format name
+	 */
+	public String getFormatName() {
+		if (format >= 0 && format < FORMAT_NAMES.length) {
+			return FORMAT_NAMES[format];
+		} else {
+			return "?";
+		}
+	}
+
+	/** 
+	 * If {@link #check()} was successful, returns one the image's vertical
+	 * resolution in pixels.
+	 * @return image height in pixels
+	 */
+	public int getHeight() {
+		return height;
+	}
+
+	private static int getIntBigEndian(byte[] a, int offs) {
+		return
+			(a[offs] & 0xff) << 24 | 
+			(a[offs + 1] & 0xff) << 16 | 
+			(a[offs + 2] & 0xff) << 8 | 
+			a[offs + 3] & 0xff;
+	}
+
+	private static int getIntLittleEndian(byte[] a, int offs) {
+		return
+			(a[offs + 3] & 0xff) << 24 | 
+			(a[offs + 2] & 0xff) << 16 | 
+			(a[offs + 1] & 0xff) << 8 | 
+			a[offs] & 0xff;
+	}
+
+	/** 
+	 * If {@link #check()} was successful, returns a String with the
+	 * MIME type of the format.
+	 * @return MIME type, e.g. <code>image/jpeg</code>
+	 */
+	public String getMimeType() {
+		if (format >= 0 && format < MIME_TYPE_STRINGS.length) {
+			if (format == FORMAT_JPEG && progressive)
+			{
+				return "image/pjpeg";
+			}
+			return MIME_TYPE_STRINGS[format];
+		} else {
+			return null;
+		}
+	}
+
+	/**
+	 * If {@link #check()} was successful and {@link #setCollectComments(boolean)} was called with
+	 * <code>true</code> as argument, returns the number of comments retrieved 
+	 * from the input image stream / file.
+	 * Any number &gt;= 0 and smaller than this number of comments is then a
+	 * valid argument for the {@link #getComment(int)} method.
+	 * @return number of comments retrieved from input image
+	 */
+	public int getNumberOfComments()
+	{
+		if (comments == null) {
+			return 0;
+		} else {
+			return comments.size();
+		}
+	}
+
+	/**
+	 * Returns the number of images in the examined file.
+	 * Assumes that <code>setDetermineImageNumber(true);</code> was called before
+	 * a successful call to {@link #check()}.
+	 * This value can currently be only different from <code>1</code> for GIF images.
+	 * @return number of images in file
+	 */
+	public int getNumberOfImages()
+	{
+		return numberOfImages;
+	}
+
+	/**
+	 * Returns the physical height of this image in dots per inch (dpi).
+	 * Assumes that {@link #check()} was successful.
+	 * Returns <code>-1</code> on failure.
+	 * @return physical height (in dpi)
+	 * @see #getPhysicalWidthDpi()
+	 * @see #getPhysicalHeightInch()
+	 */
+	public int getPhysicalHeightDpi() {
+		return physicalHeightDpi;
+	}
+
+	/**
+	 * If {@link #check()} was successful, returns the physical width of this image in dpi (dots per inch)
+	 * or -1 if no value could be found.
+	 * @return physical height (in dpi)
+	 * @see #getPhysicalHeightDpi()
+	 * @see #getPhysicalWidthDpi()
+	 * @see #getPhysicalWidthInch()
+	 */
+	public float getPhysicalHeightInch() {
+		int h = getHeight();
+		int ph = getPhysicalHeightDpi();
+		if (h > 0 && ph > 0) {
+			return ((float)h) / ((float)ph);
+		} else {
+			return -1.0f;
+		}
+	}
+
+	/**
+	 * If {@link #check()} was successful, returns the physical width of this image in dpi (dots per inch)
+	 * or -1 if no value could be found.
+	 * @return physical width (in dpi)
+	 * @see #getPhysicalHeightDpi()
+	 * @see #getPhysicalWidthInch()
+	 * @see #getPhysicalHeightInch()
+	 */
+	public int getPhysicalWidthDpi() {
+		return physicalWidthDpi;
+	}
+
+	/**
+	 * Returns the physical width of an image in inches, or
+	 * <code>-1.0f</code> if width information is not available.
+	 * Assumes that {@link #check} has been called successfully.
+	 * @return physical width in inches or <code>-1.0f</code> on failure
+	 * @see #getPhysicalWidthDpi
+	 * @see #getPhysicalHeightInch
+	 */
+	public float getPhysicalWidthInch() {
+		int w = getWidth();
+		int pw = getPhysicalWidthDpi();
+		if (w > 0 && pw > 0) {
+			return ((float)w) / ((float)pw);
+		} else {
+			return -1.0f;
+		}
+	}
+
+	private static int getShortBigEndian(byte[] a, int offs) {
+		return
+			(a[offs] & 0xff) << 8 | 
+			(a[offs + 1] & 0xff);
+	}
+
+	private static int getShortLittleEndian(byte[] a, int offs) {
+		return (a[offs] & 0xff) | (a[offs + 1] & 0xff) << 8;
+	}
+
+	/** 
+	 * If {@link #check()} was successful, returns one the image's horizontal
+	 * resolution in pixels.
+	 * @return image width in pixels
+	 */
+	public int getWidth() {
+		return width;
+	}
+
+	/**
+	 * Returns whether the image is stored in a progressive (also called: interlaced) way.
+	 * @return true for progressive/interlaced, false otherwise
+	 */
+	public boolean isProgressive()
+	{
+		return progressive;
+	}
+
+	/**
+	 * To use this class as a command line application, give it either 
+	 * some file names as parameters (information on them will be
+	 * printed to standard output, one line per file) or call
+	 * it with no parameters. It will then check data given to it
+	 * via standard input.
+	 * @param args the program arguments which must be file names
+	 */
+	public static void main(String[] args) {
+		ImageInfo imageInfo = new ImageInfo();
+		imageInfo.setDetermineImageNumber(true);
+		boolean verbose = determineVerbosity(args);
+		if (args.length == 0) {
+			run(null, System.in, imageInfo, verbose);
+		} else {
+			int index = 0;
+			while (index < args.length) {
+				InputStream in = null;
+				try {
+					String name = args[index++];
+					System.out.print(name + ";");
+					if (name.startsWith("http://")) {
+						in = new URL(name).openConnection().getInputStream();
+					} else {
+						in = new FileInputStream(name);
+					}
+					run(name, in, imageInfo, verbose);
+					in.close();
+				} catch (IOException e) {
+					System.out.println(e);
+					try {
+						if (in != null) {
+							in.close();
+						}
+					} catch (IOException ee) {
+					}
+				}
+			}
+		}
+	}
+
+	private static void print(String sourceName, ImageInfo ii, boolean verbose) {
+		if (verbose) {
+			printVerbose(sourceName, ii);
+		} else {
+			printCompact(sourceName, ii);
+		}
+	}
+
+	private static void printCompact(String sourceName, ImageInfo imageInfo) {
+		final String SEP = "\t";
+		System.out.println(
+			sourceName + SEP + 
+			imageInfo.getFormatName() + SEP +
+			imageInfo.getMimeType() + SEP +
+			imageInfo.getWidth() + SEP +
+			imageInfo.getHeight() + SEP +
+			imageInfo.getBitsPerPixel() + SEP +
+			imageInfo.getNumberOfImages() + SEP +
+			imageInfo.getPhysicalWidthDpi() + SEP +
+			imageInfo.getPhysicalHeightDpi() + SEP +
+			imageInfo.getPhysicalWidthInch() + SEP +
+			imageInfo.getPhysicalHeightInch() + SEP +
+			imageInfo.isProgressive()
+		);
+	}
+
+	private static void printLine(int indentLevels, String text, float value, float minValidValue) {
+		if (value < minValidValue) {
+			return;
+		}
+		printLine(indentLevels, text, Float.toString(value));
+	}
+
+	private static void printLine(int indentLevels, String text, int value, int minValidValue) {
+		if (value >= minValidValue) {
+			printLine(indentLevels, text, Integer.toString(value));
+		}
+	}
+
+	private static void printLine(int indentLevels, String text, String value) {
+		if (value == null || value.length() == 0) {
+			return;
+		}
+		while (indentLevels-- > 0) {
+			System.out.print("\t");
+		}
+		if (text != null && text.length() > 0) {
+			System.out.print(text);
+			System.out.print(" ");
+		}
+		System.out.println(value);
+	}
+
+	private static void printVerbose(String sourceName, ImageInfo ii) {
+		printLine(0, null, sourceName);
+		printLine(1, "File format: ", ii.getFormatName());
+		printLine(1, "MIME type: ", ii.getMimeType());
+		printLine(1, "Width (pixels): ", ii.getWidth(), 1);
+		printLine(1, "Height (pixels): ", ii.getHeight(), 1);
+		printLine(1, "Bits per pixel: ", ii.getBitsPerPixel(), 1);
+		printLine(1, "Progressive: ", ii.isProgressive() ? "yes" : "no");
+		printLine(1, "Number of images: ", ii.getNumberOfImages(), 1);
+		printLine(1, "Physical width (dpi): ", ii.getPhysicalWidthDpi(), 1);
+		printLine(1, "Physical height (dpi): ", ii.getPhysicalHeightDpi(), 1);
+		printLine(1, "Physical width (inches): ", ii.getPhysicalWidthInch(), 1.0f);
+		printLine(1, "Physical height (inches): ", ii.getPhysicalHeightInch(), 1.0f);
+		int numComments = ii.getNumberOfComments();
+		printLine(1, "Number of textual comments: ", numComments, 1);
+		if (numComments > 0) {
+			for (int i = 0; i < numComments; i++) {
+				printLine(2, null, ii.getComment(i));
+			}
+		}
+	}
+
+	private int read() throws IOException {
+		if (in != null) {
+			return in.read();
+		} else {
+			return din.readByte();
+		}
+	}
+
+	private int read(byte[] a) throws IOException {
+		if (in != null) {
+			return in.read(a);
+		} else {
+			din.readFully(a);
+			return a.length;
+		}
+	}
+
+	private int read(byte[] a, int offset, int num) throws IOException {
+		if (in != null) {
+			return in.read(a, offset, num);
+		} else {
+			din.readFully(a, offset, num);
+			return num;
+		}
+	}
+
+	private String readLine() throws IOException {
+		return readLine(new StringBuffer());
+	}
+
+	private String readLine(StringBuffer sb) throws IOException {
+		boolean finished;
+		do {
+			int value = read();
+			finished = (value == -1 || value == 10);
+			if (!finished) {
+				sb.append((char)value);
+			}
+		} while (!finished);
+		return sb.toString();
+	}
+
+	private static void run(String sourceName, InputStream in, ImageInfo imageInfo, boolean verbose) {
+		imageInfo.setInput(in);
+		imageInfo.setDetermineImageNumber(true);
+		imageInfo.setCollectComments(verbose);
+		if (imageInfo.check()) {
+			print(sourceName, imageInfo, verbose);
+		}
+	}
+
+	/**
+	 * Specify whether textual comments are supposed to be extracted from input.
+	 * Default is <code>false</code>.
+	 * If enabled, comments will be added to an internal list.
+	 * @param newValue if <code>true</code>, this class will read comments
+	 * @see #getNumberOfComments
+	 * @see #getComment
+	 */
+	public void setCollectComments(boolean newValue)
+	{
+		collectComments = newValue;
+	}
+
+	/**
+	 * Specify whether the number of images in a file is to be
+	 * determined - default is <code>false</code>.
+	 * This is a special option because some file formats require running over
+	 * the entire file to find out the number of images, a rather time-consuming
+	 * task.
+	 * Not all file formats support more than one image.
+	 * If this method is called with <code>true</code> as argument,
+	 * the actual number of images can be queried via 
+	 * {@link #getNumberOfImages()} after a successful call to
+	 * {@link #check()}.
+	 * @param newValue will the number of images be determined?
+	 * @see #getNumberOfImages
+	 */
+	public void setDetermineImageNumber(boolean newValue)
+	{
+		determineNumberOfImages = newValue;
+	}
+
+	/**
+	 * Set the input stream to the argument stream (or file). 
+	 * Note that {@link java.io.RandomAccessFile} implements
+	 * {@link java.io.DataInput}.
+	 * @param dataInput the input stream to read from
+	 */
+	public void setInput(DataInput dataInput) {
+		din = dataInput;
+		in = null;
+	}
+
+	/**
+	 * Set the input stream to the argument stream (or file).
+	 * @param inputStream the input stream to read from
+	 */
+	public void setInput(InputStream inputStream) {
+		in = inputStream;
+		din = null;
+	}
+
+	private void setPhysicalHeightDpi(int newValue) {
+		physicalWidthDpi = newValue;
+	}
+
+	private void setPhysicalWidthDpi(int newValue) {
+		physicalHeightDpi = newValue;
+	}
+
+    private void skip(int num) throws IOException {
+        while (num > 0) {
+            long result;
+            if (in != null) {
+                result = in.skip(num);
+            } else {
+                result = din.skipBytes(num);
+            }
+            if (result > 0) {
+                num -= result;
+            } else {
+                if (in != null) {
+                    result = in.read();
+                } else {
+                    result = din.readByte();
+                }
+                if (result == -1) {
+                	throw new IOException("Premature end of input.");
+                } else {
+                	num--;
+                }
+            }
+        }
+    }
+}
Index: /FCKeditor.Java/branches/2.4/java-core/src/main/javadoc/net/fckeditor/connector/package.html
===================================================================
--- /FCKeditor.Java/branches/2.4/java-core/src/main/javadoc/net/fckeditor/connector/package.html	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-core/src/main/javadoc/net/fckeditor/connector/package.html	(revision 1893)
@@ -0,0 +1,72 @@
+<!--
+ * 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 ==
+-->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+</head>
+<body bgcolor="white">
+
+Connector used by the FCKeditor to list and create resources on the server.
+
+<h2>Package Specification</h2>
+
+This servlet is access directly from the file browser in the FCKeditor.<br>
+To make everything work correctly you have to add the following piece of code in your application's web.xml
+<br>
+<pre>
+	&lt;servlet&gt;
+		&lt;servlet-name&gt;Connector&lt;/servlet-name&gt;
+		&lt;servlet-class&gt;net.fckeditor.connector.ConnectorServlet&lt;/servlet-class&gt;
+		&lt;init-param&gt;
+			&lt;param-name&gt;baseDir&lt;/param-name&gt;
+			&lt;param-value&gt;/UserFiles/&lt;/param-value&gt;
+		&lt;/init-param&gt;
+		&lt;init-param&gt;
+			&lt;param-name&gt;debug&lt;/param-name&gt;
+			&lt;param-value&gt;false&lt;/param-value&gt;
+		&lt;/init-param&gt;
+		&lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
+	&lt;/servlet&gt;
+
+	&lt;servlet-mapping&gt;
+		&lt;servlet-name&gt;Connector&lt;/servlet-name&gt;
+		&lt;url-pattern&gt;/editor/filemanager/browser/default/connectors/jsp/connector&lt;/url-pattern&gt;
+	&lt;/servlet-mapping&gt;
+</pre>
+<br>
+And put in the fckconfig.js the following line:
+<pre>
+FCKConfig.LinkBrowserURL = FCKConfig.BasePath + "filemanager/browser/default/browser.html?Connector=connectors/jsp/connector" ;
+FCKConfig.ImageBrowserURL = FCKConfig.BasePath + "filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector" ;
+FCKConfig.FlashBrowserURL = FCKConfig.BasePath + "filemanager/browser/default/browser.html?Type=Flash&Connector=connectors/jsp/connector" ;
+</pre>
+Also, since the servlet manage a file upload using the Jakarta Common fileupload library, you need to put in your <code>WEB-INF/lib/</code> the <code>commons-fileupload.jar</code>.
+<h2>Related Documentation</h2>
+
+For overviews, tutorials, examples, guides, and tool documentation, please see:
+<ul>
+  <li>_sample/jsp directory for example of how to implement FCKeditor in your application
+</ul>
+
+<!-- Put @see and @since tags down here. -->
+
+</body>
+</html>
Index: /FCKeditor.Java/branches/2.4/java-core/src/main/javadoc/net/fckeditor/package.html
===================================================================
--- /FCKeditor.Java/branches/2.4/java-core/src/main/javadoc/net/fckeditor/package.html	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-core/src/main/javadoc/net/fckeditor/package.html	(revision 1893)
@@ -0,0 +1,41 @@
+<!--
+ * 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 ==
+-->
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+</head>
+<body bgcolor="white">
+
+Core objects to manage the FCKeditor text input form.
+Java Integration Module 2.4.
+
+<h2>Related Documentation</h2>
+
+For overviews, tutorials, examples, guides, and tool documentation, please see:
+<ul>
+  <li><a href="http://www.fckeditor.net/">Official web site of FCKeditor</a>
+</ul>
+
+<!-- Put @see and @since tags down here. -->
+
+</body>
+</html>
Index: /FCKeditor.Java/branches/2.4/java-core/src/main/javadoc/net/fckeditor/tags/package.html
===================================================================
--- /FCKeditor.Java/branches/2.4/java-core/src/main/javadoc/net/fckeditor/tags/package.html	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-core/src/main/javadoc/net/fckeditor/tags/package.html	(revision 1893)
@@ -0,0 +1,49 @@
+<!--
+ * 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 ==
+-->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+</head>
+<body bgcolor="white">
+
+JSP Tag to access and modify the FCKeditor objects.
+
+
+<h2>Package Specification</h2>
+
+This taglibrary is compliant to the taglib 1.1 specification.<br>
+To use it put the FCKeditor.jar inside the <code>WEB-INF/lib</code> dir and FCKeditor.tld inside the <code>WEB-INF</code> directory of your website.<br>
+Put the following declaration in each page that use the tags:<br>
+<pre>
+&lt;%@ taglib uri="http://fckeditor.net/tags-fckeditor" prefix="FCK" %&gt;
+</pre>
+
+<h2>Related Documentation</h2>
+
+For overviews, tutorials, examples, guides, and tool documentation, please see:
+<ul>
+  <li>_sample/jsp directory for example of how to implement FCKeditor in your application
+</ul>
+
+<!-- Put @see and @since tags down here. -->
+
+</body>
+</html>
Index: /FCKeditor.Java/branches/2.4/java-core/src/main/resources/META-INF/FCKeditor.tld
===================================================================
--- /FCKeditor.Java/branches/2.4/java-core/src/main/resources/META-INF/FCKeditor.tld	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-core/src/main/resources/META-INF/FCKeditor.tld	(revision 1893)
@@ -0,0 +1,131 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
+	http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
+	version="2.0"
+>
+	<description>
+		The FCKeditor Tag Library offers a very convenient way to create
+		several FCKeditor instances with different configurations.
+		Additionally, you can check for user-based capabilities.
+	</description>
+	<display-name>FCKeditor Tag Library</display-name>
+	<icon>
+		<small-icon>fckeditor.gif</small-icon>
+	</icon>
+	<tlib-version>2.4</tlib-version>
+	<short-name>FCK</short-name>
+	<uri>http://www.fckeditor.net/tags</uri>
+	<tag>
+		<description>
+			Creates a FCKeditor instance with the given parameters.
+		</description>
+		<display-name>editor</display-name>
+		<name>editor</name>
+		<tag-class>net.fckeditor.tags.EditorTag</tag-class>
+		<body-content>JSP</body-content>
+		<attribute>
+			<description>
+				The unique instance name under which the editor can be
+				retrieved through the API.
+			</description>
+			<name>instanceName</name>
+			<required>true</required>
+			<rtexprvalue>true</rtexprvalue>
+			<type>java.lang.String</type>
+		</attribute>
+		<attribute>
+			<description>
+				Width of the FCKeditor instance in the browser window.
+			</description>
+			<name>width</name>
+			<rtexprvalue>true</rtexprvalue>
+			<type>java.lang.String</type>
+		</attribute>
+		<attribute>
+			<description>
+				Height of the FCKeditor instance in the browser window.
+			</description>
+			<name>height</name>
+			<rtexprvalue>true</rtexprvalue>
+			<type>java.lang.String</type>
+		</attribute>
+		<attribute>
+			<description>
+				The toolbar set which shall be displayed to the user.
+			</description>
+			<name>toolbarSet</name>
+			<rtexprvalue>true</rtexprvalue>
+			<type>java.lang.String</type>
+		</attribute>
+		<attribute>
+			<description>
+				The path/folder in which the editor is deployed under
+				the given context. The context path will be attached
+				automatically. (e.g. '/fckeditor')
+			</description>
+			<name>basePath</name>
+			<rtexprvalue>true</rtexprvalue>
+			<type>java.lang.String</type>
+		</attribute>
+		<attribute>
+			<description>
+				Passes any content to the FCKeditor document. Use the
+				jsp:attribute tag for large inline content. \r, \n, and
+				\t will be truncated.
+			</description>
+			<name>value</name>
+			<rtexprvalue>true</rtexprvalue>
+			<type>java.lang.String</type>
+		</attribute>
+		<example><![CDATA[
+<FCK:editor instanceName="editorDefault" height="500px" />]]>
+		</example>
+	</tag>
+	<tag>
+		<description>
+			Sets a config property of the editor to the supplied value.
+			You may provide any attribute you want for the editor. Set
+			at least one attribute per tag or several attributes with
+			one tag. This tag can only be nested within an editor tag.
+			For all configuration options see
+			<![CDATA[<a href="http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/Configuration/Configuration_Options">here</a>]]>.
+		</description>
+		<display-name>config</display-name>
+		<name>config</name>
+		<tag-class>net.fckeditor.tags.ConfigTag</tag-class>
+		<body-content>empty</body-content>
+		<dynamic-attributes>true</dynamic-attributes>
+		<example>
+			<![CDATA[
+<FCK:config SkinPath="/skins/silver/" AutoDetectLanguage="true" />]]>
+		</example>
+	</tag>
+	<tag>
+		<description>
+			Displays session-dependend and compatibility-related
+			information. This tag is intended for developers only.
+			Response messages cannot be localized, they are English
+			only.
+		</description>
+		<display-name>check</display-name>
+		<name>check</name>
+		<tag-class>net.fckeditor.tags.CheckTag</tag-class>
+		<body-content>empty</body-content>
+		<attribute>
+			<description>
+				Provide the feature name you want to check. Valid
+				features are [FileUpload, FileBrowsing,
+				CompatibleBrowser]
+			</description>
+			<name>command</name>
+			<required>true</required>
+			<type>java.lang.String</type>
+		</attribute>
+		<example><![CDATA[
+<FCK:check command="FileUpload" />
+<FCK:check command="CompatibleBrowser" />]]>
+		</example>
+	</tag>
+</taglib>
Index: /FCKeditor.Java/branches/2.4/java-core/src/main/resources/net/fckeditor/handlers/default.properties
===================================================================
--- /FCKeditor.Java/branches/2.4/java-core/src/main/resources/net/fckeditor/handlers/default.properties	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-core/src/main/resources/net/fckeditor/handlers/default.properties	(revision 1893)
@@ -0,0 +1,69 @@
+#
+# 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 ==
+#
+# Default properties for FCKeditor.Java
+#
+# @version $Id$ 
+
+# default allowed extensions settings
+connector.resourceType.file.extensions.allowed = 7z|aiff|asf|avi|bmp|csv|doc|fla|flv|gif|gz|gzip|jpeg|jpg|mid|mov|mp3|mp4|mpc|mpeg|mpg|ods|odt|pdf|png|ppt|pxd|qt|ram|rar|rm|rmi|rmvb|rtf|sdc|sitd|swf|sxc|sxw|tar|tgz|tif|tiff|txt|vsd|wav|wma|wmv|xls|xml|zip
+connector.resourceType.image.extensions.allowed = bmp|gif|jpeg|jpg|png
+connector.resourceType.flash.extensions.allowed = swf|fla
+connector.resourceType.media.extensions.allowed = aiff|asf|avi|bmp|fla|flv|gif|jpeg|jpg|mid|mov|mp3|mp4|mpc|mpeg|mpg|png|qt|ram|rm|rmi|rmvb|swf|tif|tiff|wav|wma|wmv
+
+# default resource type paths
+connector.resourceType.file.path = /file
+connector.resourceType.image.path = /image
+connector.resourceType.flash.path = /flash
+connector.resourceType.media.path = /media
+
+# Due to security issues with Apache modules, it is recommended to leave this 
+# setting enabled.
+connector.forceSingleExtension = true
+
+# base directory for the user files relative to the context root
+connector.userFilesPath = /userfiles
+
+# Instructs the Connector to return the full URL of a file/folder in the XML
+# response rather than the absolute URL
+connector.fullUrl = false
+
+# Instructs the Connector to check, if the uploaded image is really one
+connector.secureImageUploads = true
+
+# directory of the editor relative to the context root
+fckeditor.basePath = /fckeditor
+
+# default height of the editor
+fckeditor.height = 200
+
+# default toolbar set of the editor
+fckeditor.toolbarSet = Default
+
+# default width of the editor
+fckeditor.width = 100%
+
+# some messages
+message.enabled_tag.compatible_browser.no = Your browser is not compatible
+message.enabled_tag.compatible_browser.yes = Your browser is fully compatible
+message.enabled_tag.connector.file_browsing.disabled = The Connector is disabled for FileBrowsing
+message.enabled_tag.connector.file_browsing.enabled = The Connector is enabled for FileBrowsing
+message.enabled_tag.connector.file_upload.disabled = The Connector is disabled for FileUpload
+message.enabled_tag.connector.file_upload.enabled = The Connector is enabled for FileUpload
Index: /FCKeditor.Java/branches/2.4/java-core/src/site/resources/css/site.css
===================================================================
--- /FCKeditor.Java/branches/2.4/java-core/src/site/resources/css/site.css	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-core/src/site/resources/css/site.css	(revision 1893)
@@ -0,0 +1,1 @@
+@import url(../../css/site.css);
Index: /FCKeditor.Java/branches/2.4/java-core/src/test/java/net/fckeditor/handlers/CommandHandlerTest.java
===================================================================
--- /FCKeditor.Java/branches/2.4/java-core/src/test/java/net/fckeditor/handlers/CommandHandlerTest.java	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-core/src/test/java/net/fckeditor/handlers/CommandHandlerTest.java	(revision 1893)
@@ -0,0 +1,119 @@
+/*
+ * 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.handlers;
+
+import static org.junit.Assert.*;
+import org.junit.Test;
+
+/**
+ * Tests for {@link CommandHandler}.
+ * 
+ * @version $Id$
+ */
+public class CommandHandlerTest {
+
+	@Test
+	public void valueOf01() {
+		assertEquals(CommandHandler.FILE_UPLOAD, CommandHandler
+				.valueOf("FileUpload"));
+	}
+
+	@Test
+	public void valueOf02() {
+		assertEquals(CommandHandler.QUICK_UPLOAD, CommandHandler
+				.valueOf("QuickUpload"));
+	}
+
+	@Test
+	public void valueOf03() {
+		assertEquals(CommandHandler.CREATE_FOLDER, CommandHandler
+				.valueOf("CreateFolder"));
+	}
+
+	@Test
+	public void valueOf04() {
+		assertEquals(CommandHandler.GET_FOLDERS, CommandHandler
+				.valueOf("GetFolders"));
+	}
+
+	@Test
+	public void valueOf05() {
+		assertEquals(CommandHandler.GET_FOLDERS_AND_FILES, CommandHandler
+				.valueOf("GetFoldersAndFiles"));
+	}
+
+	@Test(expected = IllegalArgumentException.class)
+	public void valueOfStringNull() {
+		CommandHandler.valueOf(null);
+	}
+
+	@Test(expected = IllegalArgumentException.class)
+	public void valueOfInvalidCommand() {
+		CommandHandler.valueOf("GetAll");
+	}
+
+	@Test
+	public void getCommandNull() {
+		CommandHandler command = CommandHandler.getCommand(null);
+		assertNull(command);
+	}
+
+	@Test
+	public void getCommandInvalid() {
+		CommandHandler command = CommandHandler.getCommand("DeleteFolders");
+		assertNull(command);
+	}
+
+	@Test
+	public void getCommandValid() {
+		CommandHandler actual = CommandHandler.getCommand("FileUpload");
+		assertEquals(CommandHandler.FILE_UPLOAD, actual);
+	}
+
+	@Test
+	public void equalsNot01() {
+		assertFalse(CommandHandler.GET_FOLDERS
+				.equals(CommandHandler.FILE_UPLOAD));
+	}
+
+	@Test
+	public void equalsNot02() {
+		assertFalse(CommandHandler.GET_FOLDERS.equals(new Object()));
+	}
+
+	@Test
+	public void hashCode01() {
+		assertEquals("GetFoldersAndFiles".hashCode(),
+				CommandHandler.GET_FOLDERS_AND_FILES.hashCode());
+	}
+
+	@Test
+	public void hashCode02() {
+		assertNotSame(-1, CommandHandler.FILE_UPLOAD.hashCode());
+	}
+
+	@Test
+	public void toString01() {
+		assertEquals("GetFoldersAndFiles", CommandHandler.GET_FOLDERS_AND_FILES
+				.toString());
+	}
+
+}
Index: /FCKeditor.Java/branches/2.4/java-core/src/test/java/net/fckeditor/handlers/ExtensionsHandlerTest.java
===================================================================
--- /FCKeditor.Java/branches/2.4/java-core/src/test/java/net/fckeditor/handlers/ExtensionsHandlerTest.java	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-core/src/test/java/net/fckeditor/handlers/ExtensionsHandlerTest.java	(revision 1893)
@@ -0,0 +1,57 @@
+/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 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.handlers;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
+/**
+ * Tests for {@link ExtensionsHandler};
+ *
+ * @version $Id$
+ */
+public class ExtensionsHandlerTest {
+	
+	@Test
+	public void testIsAllowed01() {
+		ResourceTypeHandler type = ResourceTypeHandler.FILE;
+		ExtensionsHandler.setExtensionsAllowed(type, "a");
+		ExtensionsHandler.setExtensionsDenied(type, "b");
+		assertTrue(ExtensionsHandler.getExtensionsAllowed(type).isEmpty());
+		assertTrue(ExtensionsHandler.getExtensionsDenied(type).contains("b"));
+		assertFalse(ExtensionsHandler.isAllowed(type, "b"));
+		assertTrue(ExtensionsHandler.isAllowed(type, "a"));
+		assertTrue(ExtensionsHandler.isAllowed(type, "c"));
+	}
+	
+	@Test
+	public void testIsAllowed02() {
+		ResourceTypeHandler type = ResourceTypeHandler.FILE;
+		ExtensionsHandler.setExtensionsAllowed(type, "a|b|c");
+		assertTrue(ExtensionsHandler.isAllowed(type, "a"));
+		assertTrue(ExtensionsHandler.isAllowed(type, "b"));
+		assertTrue(ExtensionsHandler.isAllowed(type, "c"));
+		assertFalse(ExtensionsHandler.isAllowed(type, "d"));
+	}
+
+}
Index: /FCKeditor.Java/branches/2.4/java-core/src/test/java/net/fckeditor/handlers/ResourceTypeHandlerTest.java
===================================================================
--- /FCKeditor.Java/branches/2.4/java-core/src/test/java/net/fckeditor/handlers/ResourceTypeHandlerTest.java	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-core/src/test/java/net/fckeditor/handlers/ResourceTypeHandlerTest.java	(revision 1893)
@@ -0,0 +1,89 @@
+/*
+ * 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.handlers;
+
+import static org.junit.Assert.*;
+import net.fckeditor.handlers.PropertiesLoader;
+import net.fckeditor.handlers.ResourceTypeHandler;
+
+import org.junit.Test;
+
+/**
+ * Tests for {@link ResourceTypeHandler}.
+ * 
+ * @version $Id: ResourceTypeHandlerTest.java 1585 2008-02-21 18:13:09Z th-schwarz $
+ */
+public class ResourceTypeHandlerTest {
+
+	@Test
+	public void getType01() throws Exception {
+		assertNull(ResourceTypeHandler.getResourceType("xyz"));
+	}
+
+	@Test
+	public void getType02() throws Exception {
+		assertEquals(ResourceTypeHandler.FILE, ResourceTypeHandler.getResourceType("File"));
+	}
+
+	@Test
+	public void getType03() throws Exception {
+		assertEquals(ResourceTypeHandler.IMAGE, ResourceTypeHandler.getResourceType("Image"));
+	}
+
+	@Test
+	public void isValid01() throws Exception {
+		assertFalse(ResourceTypeHandler.isValid("1234"));
+	}
+
+	@Test
+	public void isValid02() throws Exception {
+		assertFalse(ResourceTypeHandler.isValid("fLash"));
+	}
+
+	@Test
+	public void isValid03() throws Exception {
+		assertFalse(ResourceTypeHandler.isValid("MeDiA"));
+	}
+
+	@Test
+	public void getTypeDefault01() throws Exception {
+		assertEquals(ResourceTypeHandler.FILE, ResourceTypeHandler
+				.getDefaultResourceType("wrong-type"));
+	}
+
+	@Test
+	public void getTypeDefault02() throws Exception {
+		assertNotSame(ResourceTypeHandler.FLASH, ResourceTypeHandler
+				.getDefaultResourceType("flAsh"));
+	}
+
+	@Test
+	public void getSubDirForType01() throws Exception {
+		assertEquals(PropertiesLoader.getProperty("connector.resourceType.file.path"), 
+				ResourceTypeHandler.getDefaultResourceType(null).getPath());
+	}
+
+	@Test
+	public void getSubDirForType02() throws Exception {
+		assertEquals(PropertiesLoader.getProperty("connector.resourceType.image.path"), 
+				ResourceTypeHandler.getResourceType("Image").getPath());
+	}
+}
Index: /FCKeditor.Java/branches/2.4/java-core/src/test/java/net/fckeditor/tool/CompatibilityTest.java
===================================================================
--- /FCKeditor.Java/branches/2.4/java-core/src/test/java/net/fckeditor/tool/CompatibilityTest.java	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-core/src/test/java/net/fckeditor/tool/CompatibilityTest.java	(revision 1893)
@@ -0,0 +1,113 @@
+/*
+ * 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.tool;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+/**
+ * Tests for {@link Compatibility}.<br>
+ * User-Agent-Strings are taken from: http://www.useragentstring.com/pages/useragentstring.php <br>
+ * 
+ * @version $Id$
+ */
+public class CompatibilityTest {
+
+	@Test
+	public void testIE4Win() throws Exception {
+	    assertFalse(Compatibility.check("Mozilla/4.0 (compatible; MSIE 4.01; Windows NT 5.0)"));
+    }
+	
+	@Test
+	public void testIE522Mac() throws Exception {
+	    assertFalse(Compatibility.check("Mozilla/4.0 (compatible; MSIE 5.22; Mac_PowerPC)"));
+    }
+	
+	@Test
+	public void testIE55Win98() throws Exception {
+	    assertTrue(Compatibility.check("Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)"));
+    }
+
+	@Test
+	public void testIE60WinNT() throws Exception {
+	    assertTrue(Compatibility.check("Mozilla/4.0 (compatible; MSIE 6.0; MSIE 5.5; Windows NT 5.1)"));
+    }
+	
+	@Test
+	public void testIE70WinVista() throws Exception {
+	    assertTrue(Compatibility.check("Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0;)"));
+    }
+
+	@Test
+	public void testIE70bWinVista() throws Exception {
+	    assertTrue(Compatibility.check("Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 6.0)"));
+    }
+	
+	@Test
+	public void testSafari204OSX() throws Exception {
+	    assertFalse(Compatibility.check("Mozilla/5.0 (Macintosh; U; PPC Mac OS X; sv-se) AppleWebKit/419 (KHTML, like Gecko) Safari/419.3"));
+    }
+
+	@Test
+	public void testSafari30WinXP() throws Exception {
+	    assertTrue(Compatibility.check("Mozilla/5.0 (Windows; U; Windows NT 5.2; pt) AppleWebKit/522.11.3 (KHTML, like Gecko) Version/3.0 Safari/522.11.3"));
+    }
+
+	@Test
+	public void testSafari302OSX() throws Exception {
+	    assertTrue(Compatibility.check("Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en) AppleWebKit/522+ (KHTML, like Gecko) Version/3.0.2 Safari/522.12"));
+    }
+
+	@Test
+	public void testSafari31OSX() throws Exception {
+	    assertTrue(Compatibility.check("Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_2; en-au) AppleWebKit/525.8+ (KHTML, like Gecko) Version/3.1 Safari/525.6"));
+    }
+
+	@Test
+	public void testFirefox200112OSX() throws Exception {
+	    assertTrue(Compatibility.check("Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12"));
+    }
+
+	@Test
+	public void testFirefox1509LinuxDebian() throws Exception {
+	    assertTrue(Compatibility.check("Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.9) Gecko/20071025 Firefox/1.5.0.9 (Debian-2.0.0.9-2)"));
+    }
+	
+	@Test
+	public void testOper925Win2k() throws Exception {
+	    assertFalse(Compatibility.check("Opera/9.25 (Windows NT 5.0; U; en)"));
+    }
+	
+	@Test
+	public void testOpera854WinNT() throws Exception {
+	    assertFalse(Compatibility.check("Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; de) Opera 8.54"));
+    }
+	
+	@Test
+	public void testOpera95OSX() throws Exception {
+		assertTrue(Compatibility.check("Opera/9.50 (Macintosh; Intel Mac OS X; U; en)"));   
+    }
+	
+	@Test
+	public void testOpera95WinVista() throws Exception {
+		assertTrue(Compatibility.check("Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 6.0; en) Opera 9.50"));   
+    }
+}
Index: /FCKeditor.Java/branches/2.4/java-core/src/test/java/net/fckeditor/tool/UploadResponseTest.java
===================================================================
--- /FCKeditor.Java/branches/2.4/java-core/src/test/java/net/fckeditor/tool/UploadResponseTest.java	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-core/src/test/java/net/fckeditor/tool/UploadResponseTest.java	(revision 1893)
@@ -0,0 +1,69 @@
+package net.fckeditor.tool;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+import net.fckeditor.response.UploadResponse;
+
+public class UploadResponseTest {
+
+	@Test(expected = IllegalArgumentException.class)
+	public void noArguments() throws Exception {
+		new UploadResponse();
+	}
+
+	@Test(expected = IllegalArgumentException.class)
+	public void tooManyArguments() throws Exception {
+		new UploadResponse(101, "/some/url/file.txt", "file.txt",
+				"something's wrong", "arg no. 5");
+	}
+
+	@Test(expected = IllegalArgumentException.class)
+	public void notANumber() throws Exception {
+		new UploadResponse("1");
+	}
+
+	@Test
+	public void onlyErrorNumber() throws Exception {
+		UploadResponse actual = new UploadResponse(
+				UploadResponse.EN_INVALID_EXTENSION);
+		String expected = new String("<script type=\"text/javascript\">\n"
+				+ "window.parent.OnUploadCompleted(202);\n</script>");
+		assertEquals(expected, actual.toString());
+	}
+	
+	@Test
+	public void fourArguments() throws Exception {
+		UploadResponse actual = new UploadResponse(UploadResponse.EN_OK,"/fckeditor-java/userfiles/image/fredck.jpg");
+		String expected = new String("<script type=\"text/javascript\">\n"
+				+ "window.parent.OnUploadCompleted(0,'/fckeditor-java/userfiles/image/fredck.jpg');\n</script>");
+		assertEquals(expected, actual.toString());
+	}
+	
+	@Test
+	public void renamedFile() throws Exception {
+		UploadResponse actual = new UploadResponse(UploadResponse.EN_RENAMED,"/fckeditor-java/userfiles/image/hacked_php.txt","hacked_php.txt");
+		String expected = new String("<script type=\"text/javascript\">\n"
+				+ "window.parent.OnUploadCompleted(201,'/fckeditor-java/userfiles/image/hacked_php.txt','hacked_php.txt');\n</script>");
+		assertEquals(expected, actual.toString());
+	}
+
+	@Test
+	public void customMessage() throws Exception {
+		UploadResponse actual = new UploadResponse(UploadResponse.EN_ERROR);
+		actual.setCustomMessage("some error");
+		String expected = new String("<script type=\"text/javascript\">\n"
+				+ "window.parent.OnUploadCompleted(1,'','','some error');\n</script>");
+		assertEquals(expected, actual.toString());
+	}
+
+
+	@Test
+	public void nullArguments() throws Exception {
+		UploadResponse actual = new UploadResponse(UploadResponse.EN_ERROR,null,null,null);
+		String expected = new String("<script type=\"text/javascript\">\n"
+				+ "window.parent.OnUploadCompleted(1,'','','');\n</script>");
+		assertEquals(expected, actual.toString());
+	}
+
+}
Index: /FCKeditor.Java/branches/2.4/java-core/src/test/java/net/fckeditor/tool/UtilsFileTest.java
===================================================================
--- /FCKeditor.Java/branches/2.4/java-core/src/test/java/net/fckeditor/tool/UtilsFileTest.java	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-core/src/test/java/net/fckeditor/tool/UtilsFileTest.java	(revision 1893)
@@ -0,0 +1,199 @@
+/*
+ * 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.tool;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
+
+/**
+ * Tests for {@link UtilsFile}.
+ *
+ * @version $Id$
+ */
+public class UtilsFileTest {
+
+	@Test
+    public void isSingleExtension01() {
+    	boolean condition = UtilsFile.isSingleExtension("hacked.txt");
+    	assertTrue(condition);
+    }
+
+	@Test
+    public void isSingleExtension02() {
+    	boolean condition = UtilsFile.isSingleExtension("hacked.php_txt");
+    	assertTrue(condition);
+    }
+
+	@Test
+    public void isSingleExtension03() {
+    	boolean condition = UtilsFile.isSingleExtension("hacked.php.txt");
+    	assertFalse(condition);
+    }
+
+	@Test
+    public void isSingleExtension04() {
+    	boolean condition = UtilsFile.isSingleExtension("hacked.txt.");
+    	assertFalse(condition);
+    }
+
+	@Test
+    public void isSingleExtension05() {
+    	boolean condition = UtilsFile.isSingleExtension("hacked..txt");
+    	assertFalse(condition);
+    }
+
+	@Test
+    public void forceSingleExtension01() {
+    	String actual = UtilsFile.forceSingleExtension("hacked.txt");
+    	assertEquals("hacked.txt", actual);
+    }
+
+	@Test
+    public void forceSingleExtension02() {
+    	String actual = UtilsFile.forceSingleExtension("hacked.php_txt");
+    	assertEquals("hacked.php_txt", actual);
+    }
+
+	@Test
+    public void forceSingleExtension03() {
+    	String actual = UtilsFile.forceSingleExtension("hacked.php.txt");
+    	assertEquals("hacked_php.txt", actual);
+    }
+
+	@Test
+    public void forceSingleExtension04() {
+    	String actual = UtilsFile.forceSingleExtension("hacked..txt");
+    	assertEquals("hacked_.txt", actual);
+    }
+
+	@Test
+    public void isValidPath01() {
+    	String path = "";
+    	boolean condition = UtilsFile.isValidPath(path);
+    	assertFalse(condition);
+    }
+
+	@Test
+    public void isValidPath02() {
+    	String path = "/";
+    	boolean condition = UtilsFile.isValidPath(path);
+    	assertTrue(condition);
+    }
+
+	@Test
+    public void isValidPath03() {
+    	String path = "/./";
+    	boolean condition = UtilsFile.isValidPath(path);
+    	assertFalse(condition);
+    }
+
+	@Test
+    public void isValidPath04() {
+    	String path = "/newf/..";
+    	boolean condition = UtilsFile.isValidPath(path);
+    	assertFalse(condition);
+    }
+
+	@Test
+    public void isValidPath05() {
+    	String path = "/../";
+    	boolean condition = UtilsFile.isValidPath(path);
+    	assertFalse(condition);
+    }
+
+	@Test
+    public void isValidPath06() {
+    	String path = "/stuff/../..";
+    	boolean condition = UtilsFile.isValidPath(path);
+    	assertFalse(condition);
+    }
+
+	@Test
+    public void isValidPath07() {
+    	String path = "/my/stuff/../";
+    	boolean condition = UtilsFile.isValidPath(path);
+    	assertFalse(condition);
+    }
+
+	@Test
+    public void isValidPath08() {
+    	String path = "/my/stuff/";
+    	boolean condition = UtilsFile.isValidPath(path);
+    	assertTrue(condition);
+    }
+
+	@Test
+    public void isValidPath09() {
+    	String path = "/my/stuff";
+    	boolean condition = UtilsFile.isValidPath(path);
+    	assertFalse(condition);
+    }
+
+	@Test
+    public void isValidPath10() {
+    	String path = "my/stuff/";
+    	boolean condition = UtilsFile.isValidPath(path);
+    	assertFalse(condition);
+    }
+	
+	@Test
+    public void isValidPath11() {
+    	String path = "/some/pa\\th/";
+    	boolean condition = UtilsFile.isValidPath(path);
+    	assertFalse(condition);
+    }
+	
+	@Test
+    public void isValidPath12() {
+    	String path = "/\\/";
+    	boolean condition = UtilsFile.isValidPath(path);
+    	assertFalse(condition);
+    }
+
+	@Test
+    public void sanitizeFolder01() {
+    	assertEquals("a_b_c_d_e_f_g_h_i_", UtilsFile.sanitizeFolderName("a.b|c<d>e:f?g*h<i>"));
+    }
+	
+	@Test
+	public void sanitizeFolder02() {
+		assertEquals("a_b_c_d_e_f_g_h_i_", UtilsFile.sanitizeFolderName("a.b|c\u007Fd>e:f\u0005g*h<i>"));
+	}
+
+	@Test
+    public void sanitizeFile01() {
+    	assertEquals("b_c_d_e_f_g_h_i_", UtilsFile.sanitizeFileName("b|c<d>e:f?g*h<i>"));
+    }
+
+	@Test
+    public void sanitizeFile02() {
+    	assertEquals("name_ext1.ext2", UtilsFile.sanitizeFileName("name.ext1.ext2"));
+    }
+
+	@Test
+	public void sanitizeFile03() {
+		assertEquals("b_c_d_e_f_g_h_i_", UtilsFile.sanitizeFileName("b|c\u007Fd>e:f\u0005g*h<i>"));
+	}
+}
Index: /FCKeditor.Java/branches/2.4/java-core/src/test/java/net/fckeditor/tool/UtilsTest.java
===================================================================
--- /FCKeditor.Java/branches/2.4/java-core/src/test/java/net/fckeditor/tool/UtilsTest.java	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-core/src/test/java/net/fckeditor/tool/UtilsTest.java	(revision 1893)
@@ -0,0 +1,101 @@
+/*
+ * 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.tool;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.junit.Test;
+
+/**
+ * Tests for {@link Utils};
+ * 
+ * @version $Id$
+ */
+public class UtilsTest {
+
+	@Test
+	public void getSet01() {
+		Set<String> set = new HashSet<String>();
+		set.add("a");
+		set.add("ab");
+		set.add("c");
+
+		Set<String> newSet = Utils.getSet("a|Ab|c", "|");
+		for (String string : newSet) {
+			assertTrue(set.contains(string));
+		}
+	}
+
+	@Test
+	public void getSet02() {
+		Set<String> set = new HashSet<String>();
+		set.add("png");
+		set.add("jpg");
+		set.add("gif");
+
+		Set<String> newSet = Utils.getSet("png|jpg|gif");
+		for (String string : newSet) {
+			assertTrue(set.contains(string));
+		}
+	}
+	
+	@Test
+	public void getSet03() {
+		Set<String> set = Utils.getSet(null);
+		assertTrue(set != null);
+		assertTrue(set.isEmpty());
+	}
+
+	@Test
+	public void getSet04() {
+		Set<String> set = Utils.getSet("");
+		assertTrue(set != null);
+		assertTrue(set.isEmpty());
+	}
+
+	@Test
+	public void replaceAll01() {
+		String str = Utils.replaceAll("//a/b//c", "//", "/");
+		assertEquals(str, "/a/b/c");
+	}
+
+	@Test
+	public void replaceAll02() {
+		String str = Utils.replaceAll(null, "a", "c");
+		assertEquals(str, "");
+	}
+
+	@Test
+	public void replaceAll03() {
+		String str = Utils.replaceAll("foo", null, "c");
+		assertEquals(str, "foo");
+	}
+
+	@Test
+	public void replaceAll04() {
+		String str = Utils.replaceAll("foo", "o", "a");
+		assertEquals(str, "faa");
+	}
+}
Index: /FCKeditor.Java/branches/2.4/java-core/src/test/java/net/fckeditor/tool/XHtmlTagToolTest.java
===================================================================
--- /FCKeditor.Java/branches/2.4/java-core/src/test/java/net/fckeditor/tool/XHtmlTagToolTest.java	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-core/src/test/java/net/fckeditor/tool/XHtmlTagToolTest.java	(revision 1893)
@@ -0,0 +1,103 @@
+/*
+ * 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.tool;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+
+/**
+ * Tests for {@link XHtmlTagTool}.
+ *
+ * @version $Id$
+ */
+public class XHtmlTagToolTest {
+
+	@Test
+	public void testClosingTag01() throws Exception {
+	    XHtmlTagTool tag = new XHtmlTagTool("test");
+	    assertEquals("<test />", tag.toString());
+    }
+	
+	@Test
+	public void testClosingTag02() throws Exception {
+	    XHtmlTagTool tag = new XHtmlTagTool("test", "");
+	    assertEquals("<test />", tag.toString());
+    }
+
+	@Test
+	public void testClosingTag03() throws Exception {
+	    XHtmlTagTool tag = new XHtmlTagTool("test", "val");
+	    assertEquals("<test>val</test>", tag.toString());
+    }
+	
+	@Test
+	public void testClosingTag04() throws Exception {
+	    XHtmlTagTool tag = new XHtmlTagTool("test", XHtmlTagTool.SPACE);
+	    assertEquals("<test> </test>", tag.toString());
+    }
+	
+	@Test
+	public void deepEquals01() throws Exception {
+		XHtmlTagTool expected = new XHtmlTagTool("tag", "some text");
+		XHtmlTagTool actual = new XHtmlTagTool("tag", "some text");
+		assertEquals(expected, actual);
+	}
+	
+	@Test
+	public void deepEquals02() throws Exception {
+		XHtmlTagTool unexpected = new XHtmlTagTool("tag", "");
+		XHtmlTagTool actual = new XHtmlTagTool("tag", XHtmlTagTool.SPACE);
+		assertNotSame(unexpected, actual);
+	}
+	
+	@Test
+	public void deepEquals03() throws Exception {
+		XHtmlTagTool expected = new XHtmlTagTool("tag", "some text");
+		expected.addAttribute("id", "some_tag_id");
+		expected.addAttribute("class", "grayShadow");
+		expected.addAttribute("style", "color: red");
+		
+		XHtmlTagTool actual = new XHtmlTagTool("tag", "some text");
+		
+		actual.addAttribute("style", "color: red");
+		actual.addAttribute("id", "some_tag_id");
+		actual.addAttribute("class", "grayShadow");
+		
+		assertEquals(expected, actual);
+	}
+	
+	@Test
+	public void deepEquals04() throws Exception {
+		XHtmlTagTool unexpected = new XHtmlTagTool("tag");
+		unexpected.addAttribute("id", "some_tag_id");
+		unexpected.addAttribute("class", "grayShadow");
+		unexpected.addAttribute("style", "color: red");
+		
+		XHtmlTagTool actual = new XHtmlTagTool("tag");
+		
+		actual.addAttribute("id", "some_tag_id");
+		actual.addAttribute("class", "grayShadow");
+		actual.addAttribute("style", "color: blue");
+		
+		assertNotSame(unexpected, actual);
+	}
+}
Index: /FCKeditor.Java/branches/2.4/java-demo/pom.xml
===================================================================
--- /FCKeditor.Java/branches/2.4/java-demo/pom.xml	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-demo/pom.xml	(revision 1893)
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+                      http://maven.apache.org/xsd/maven-4.0.0.xsd"
+>
+	<modelVersion>4.0.0</modelVersion>
+	<artifactId>java-demo</artifactId>
+	<packaging>war</packaging>
+	<dependencies>
+		<dependency>
+			<groupId>net.fckeditor</groupId>
+			<artifactId>java-core</artifactId>
+			<version>${parent.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.slf4j</groupId>
+			<artifactId>slf4j-simple</artifactId>
+			<version>1.5.0</version>
+			<scope>runtime</scope>
+		</dependency>
+	</dependencies>
+	<parent>
+		<groupId>net.fckeditor</groupId>
+		<artifactId>fckeditor-java</artifactId>
+		<version>2.4-SNAPSHOT</version>
+	</parent>
+
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.mortbay.jetty</groupId>
+				<artifactId>maven-jetty-plugin</artifactId>
+			</plugin>
+			<plugin>
+				<artifactId>maven-war-plugin</artifactId>
+				<configuration>
+					<webResources>
+						<resource>
+							<targetPath>fckeditor</targetPath>
+							<directory>../../fckeditor</directory>
+							<filtering>false</filtering>
+							<includes>
+								<include>_samples/_plugins/</include>
+								<include>editor/</include>
+								<include>fckconfig.js</include>
+								<include>*.xml</include>
+							</includes>
+							<excludes>
+								<exclude>
+									editor/filemanager/connectors/
+								</exclude>
+							</excludes>
+						</resource>
+						<resource>
+							<directory>..</directory>
+							<filtering>false</filtering>
+							<includes>
+								<include>LICENSE.txt</include>
+							</includes>
+						</resource>
+					</webResources>
+					<archive>
+						<addMavenDescriptor>false</addMavenDescriptor>
+						<manifest>
+							<addDefaultImplementationEntries>
+								true
+							</addDefaultImplementationEntries>
+						</manifest>
+						<manifestEntries>
+							<Implementation-URL>
+								${project.url}
+							</Implementation-URL>
+							<Built-By>${organization.name}</Built-By>
+						</manifestEntries>
+					</archive>
+				</configuration>
+			</plugin>
+			<plugin>
+				<artifactId>maven-clean-plugin</artifactId>
+				<configuration>
+					<filesets>
+						<fileset>
+							<directory>src/main/webapp</directory>
+							<includes>
+								<include>fckeditor/</include>
+								<include>userfiles/</include>
+							</includes>
+						</fileset>
+					</filesets>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+
+	<reporting>
+		<plugins>
+			<plugin>
+				<artifactId>
+					maven-project-info-reports-plugin
+				</artifactId>
+				<reportSets>
+					<reportSet>
+						<reports>
+							<report>dependencies</report>
+							<report>summary</report>
+						</reports>
+					</reportSet>
+				</reportSets>
+			</plugin>
+		</plugins>
+	</reporting>
+	<name>FCKeditor.Java Integration Demo Webapp</name>
+	<description>
+		This is a drop-in demo of the FCKeditor.Java Integration. It's
+		preconfigured with the Java library and a recent FCKeditor version.
+	</description>
+</project>
Index: /FCKeditor.Java/branches/2.4/java-demo/src/main/resources/fckeditor.properties
===================================================================
--- /FCKeditor.Java/branches/2.4/java-demo/src/main/resources/fckeditor.properties	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-demo/src/main/resources/fckeditor.properties	(revision 1893)
@@ -0,0 +1,1 @@
+connector.sessionDataImpl=net.fckeditor.impl.BasicSessionData
Index: /FCKeditor.Java/branches/2.4/java-demo/src/main/resources/log4j.properties
===================================================================
--- /FCKeditor.Java/branches/2.4/java-demo/src/main/resources/log4j.properties	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-demo/src/main/resources/log4j.properties	(revision 1893)
@@ -0,0 +1,12 @@
+log4j.rootLogger=DEBUG, SOCKET
+log4j.appender.FILE=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
+#log4j.appender.FILE.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss,SSS} %-5p %c - %m%n
+log4j.appender.FILE.layout.ConversionPattern=%d{HH:mm:ss,SSS} %-5p %c - %m%n
+log4j.appender.FILE.file=log/pmcms.log
+
+log4j.appender.SOCKET=org.apache.log4j.net.SocketAppender
+log4j.appender.SOCKET.RemoteHost=localhost
+log4j.appender.SOCKET.Port=4445
+
+log4j.logger.org.apache=WARN
Index: /FCKeditor.Java/branches/2.4/java-demo/src/main/webapp/WEB-INF/web.xml
===================================================================
--- /FCKeditor.Java/branches/2.4/java-demo/src/main/webapp/WEB-INF/web.xml	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-demo/src/main/webapp/WEB-INF/web.xml	(revision 1893)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.4" id="fckeditor-java" xmlns="http://java.sun.com/xml/ns/j2ee"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+>
+<display-name>FCKeditor.Java Sample Web Application</display-name>
+	<description>FCKeditor.Java Sample Web Application</description>
+
+	<servlet>
+		<servlet-name>Connector</servlet-name>
+		<servlet-class>
+			net.fckeditor.connector.ConnectorServlet
+		</servlet-class>
+		<load-on-startup>1</load-on-startup>
+	</servlet>
+
+	<servlet-mapping>
+		<servlet-name>Connector</servlet-name>
+		<url-pattern>
+			/fckeditor/editor/filemanager/connectors/*
+		</url-pattern>
+	</servlet-mapping>
+</web-app>
Index: /FCKeditor.Java/branches/2.4/java-demo/src/main/webapp/index.jsp
===================================================================
--- /FCKeditor.Java/branches/2.4/java-demo/src/main/webapp/index.jsp	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-demo/src/main/webapp/index.jsp	(revision 1893)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+	pageEncoding="UTF-8"%>
+<%--
+ * 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 ==
+--%>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" 
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+	<head>
+		<title>FCKeditor - Samples</title>
+		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+		<meta name="robots" content="noindex, nofollow" />
+	</head>
+	<frameset rows="60,*">
+		<frame src="sampleslist.jsp" noresize ="noresize" scrolling="no" />
+		<frame name="Sample" src="jsp/sample01.jsp" noresize="noresize" />
+	</frameset>
+</html>
Index: /FCKeditor.Java/branches/2.4/java-demo/src/main/webapp/jsp/sample01.jsp
===================================================================
--- /FCKeditor.Java/branches/2.4/java-demo/src/main/webapp/jsp/sample01.jsp	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-demo/src/main/webapp/jsp/sample01.jsp	(revision 1893)
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+	pageEncoding="UTF-8" import="net.fckeditor.*" %>
+<%@ taglib uri="http://www.fckeditor.net/tags" prefix="FCK" %>
+<%--
+ * 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 ==
+--%>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+	<head>
+		<title>FCKeditor - JSP Sample</title>
+		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+		<meta name="robots" content="noindex, nofollow" />
+		<link href="../sample.css" rel="stylesheet" type="text/css" />
+		<script type="text/javascript">
+			function FCKeditor_OnComplete(editorInstance) {
+				window.status = editorInstance.Description;
+			}
+		</script>
+	</head>
+	<%
+		FCKeditor fckEditor = new FCKeditor(request, "EditorDefault");
+	%>
+	<body>
+		<h1>FCKeditor - JSP - Sample 1</h1>
+		<p>This sample displays a normal HTML form with an FCKeditor with
+		full features enabled.</p>
+		<p>Basic FCKeditor informations:</p>
+		<ul>
+			<li><FCK:check command="CompatibleBrowser" /></li>
+			<li><FCK:check command="FileBrowsing" /></li>
+			<li><FCK:check command="FileUpload" /></li>
+		</ul>
+		<hr />
+		<form action="sampleposteddata.jsp" method="get" target="_blank">
+		<%
+			fckEditor.setValue("This is some <strong>sample text</strong>. You are using <a href=\"http://www.fckeditor.net\">FCKeditor</a>.");
+			out.println(fckEditor);
+		%>
+		<br />
+		<input type="submit" value="Submit" /></form>
+	</body>
+</html>
Index: /FCKeditor.Java/branches/2.4/java-demo/src/main/webapp/jsp/sample02.jsp
===================================================================
--- /FCKeditor.Java/branches/2.4/java-demo/src/main/webapp/jsp/sample02.jsp	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-demo/src/main/webapp/jsp/sample02.jsp	(revision 1893)
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+	pageEncoding="UTF-8" %>
+<%@ taglib uri="http://www.fckeditor.net/tags" prefix="FCK" %>
+<%--
+ * 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 ==
+--%>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+	<head>
+		<title>FCKeditor - JSP Sample</title>
+		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+		<meta name="robots" content="noindex, nofollow" />
+		<link href="../sample.css" rel="stylesheet" type="text/css" />
+		<script type="text/javascript">
+			function FCKeditor_OnComplete(editorInstance) {
+				window.status = editorInstance.Description;
+			}
+		</script>
+	</head>
+	<body>
+		<h1>FCKeditor - JSP - Sample 2</h1>
+		This sample displays a normal HTML form with an FCKeditor with full 
+		features enabled.<br />
+		This sample uses the FCKeditor Taglib: this method is preferred to 
+		<a href="sample01.jsp">the API version</a><br />
+		All other sample pages will use this method.
+		<hr />
+		<form action="sampleposteddata.jsp" method="get" target="_blank">
+			<FCK:editor instanceName="EditorDefault">
+				<jsp:attribute name="value">This is some <strong>sample text
+					</strong>. You are using <a href="http://www.fckeditor.net">
+					FCKeditor</a>.
+				</jsp:attribute>
+			</FCK:editor>
+			<br />
+			<input type="submit" value="Submit" />
+		</form>
+	</body>
+</html>
Index: /FCKeditor.Java/branches/2.4/java-demo/src/main/webapp/jsp/sample03.jsp
===================================================================
--- /FCKeditor.Java/branches/2.4/java-demo/src/main/webapp/jsp/sample03.jsp	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-demo/src/main/webapp/jsp/sample03.jsp	(revision 1893)
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+	pageEncoding="UTF-8" %>
+<%@ taglib uri="http://www.fckeditor.net/tags" prefix="FCK" %>
+<%--
+ * 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 ==
+--%>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+	<head>
+		<title>FCKeditor - JSP Sample</title>
+		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+		<meta name="robots" content="noindex, nofollow" />
+		<link href="../sample.css" rel="stylesheet" type="text/css" />
+		<script type="text/javascript">
+			function FCKeditor_OnComplete(editorInstance) {
+				var oCombo = document.getElementById( 'cmbLanguages' );
+				for (code in editorInstance.Language.AvailableLanguages) {
+					AddComboOption( oCombo,	editorInstance.Language.AvailableLanguages[code] + '(' + code + ')', code);
+				}
+
+				oCombo.value = editorInstance.Language.ActiveLanguage.Code;
+			}
+
+			function AddComboOption(combo, optionText, optionValue) {
+				var oOption = document.createElement("OPTION");
+				combo.options.add(oOption);
+
+				oOption.innerHTML = optionText;
+				oOption.value = optionValue;
+	
+				return oOption;
+			}
+
+			function ChangeLanguage(languageCode) {
+				if (languageCode != "-1")
+					window.location.href = window.location.pathname + "?code=" + languageCode;
+			}
+		</script>
+	</head>
+	<body>
+		<h1>FCKeditor - JSP - Sample 3</h1>
+		This sample shows the editor in all it's available languages.<br />
+		The Language dropdown is populated with JavaScript API.
+		<hr />
+		<table cellpadding="0" cellspacing="0" border="0">
+			<tr>
+				<td>
+					Select a language:&nbsp;
+				</td>
+				<td>
+					<select id="cmbLanguages" onchange="ChangeLanguage(this.value);" >
+						<option value="-1">none selected</option>
+					</select>
+				</td>
+			</tr>
+		</table>
+		<br />
+		<form action="sampleposteddata.jsp" method="get" target="_blank">
+			<FCK:editor instanceName="EditorDefault">
+				<jsp:attribute name="value">This is some <strong>sample text
+					</strong>. You are using <a href="http://www.fckeditor.net">
+					FCKeditor</a>.
+				</jsp:attribute>
+				<jsp:body>
+					<FCK:config AutoDetectLanguage="${empty param.code ? true : false}"
+						DefaultLanguage="${empty param.code ? 'en' : param.code}" />
+				</jsp:body>
+			</FCK:editor>
+			<br />
+			<input type="submit" value="Submit" />
+		</form>
+	</body>
+</html>
Index: /FCKeditor.Java/branches/2.4/java-demo/src/main/webapp/jsp/sample04.jsp
===================================================================
--- /FCKeditor.Java/branches/2.4/java-demo/src/main/webapp/jsp/sample04.jsp	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-demo/src/main/webapp/jsp/sample04.jsp	(revision 1893)
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+	pageEncoding="UTF-8" %>
+<%@ taglib uri="http://www.fckeditor.net/tags" prefix="FCK" %>
+<%--
+ * 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 ==
+--%>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+	<head>
+		<title>FCKeditor - JSP Sample</title>
+		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+		<meta name="robots" content="noindex, nofollow" />
+		<link href="../sample.css" rel="stylesheet" type="text/css" />
+		<script type="text/javascript">
+			function FCKeditor_OnComplete(editorInstance) {
+				var oCombo = document.getElementById('cmbToolbars');
+				oCombo.value = editorInstance.ToolbarSet.Name;
+				oCombo.style.visibility = '';
+			}
+
+			function ChangeToolbarSet(toolbarSet) {
+				window.location.href = window.location.pathname + "?toolbar=" + toolbarSet;
+			}
+			</script>
+	</head>
+	<body>
+		<h1>FCKeditor - JSP - Sample 4</h1>
+		This sample shows how to change the editor toolbar.
+		<hr />
+		<table cellpadding="0" cellspacing="0" border="0">
+			<tr>
+				<td>
+					Select the toolbar to load:&nbsp;
+				</td>
+				<td>
+					<select id="cmbToolbars" onchange="ChangeToolbarSet(this.value);" style="visibility: hidden">
+						<option value="Default" selected="selected">Default</option>
+						<option value="Basic">Basic</option>
+					</select>
+				</td>
+			</tr>
+		</table>
+		<br />
+		<form action="sampleposteddata.jsp" method="get" target="_blank">
+			<FCK:editor instanceName="EditorDefault" toolbarSet="${param.toolbar}">
+				<jsp:attribute name="value">This is some <strong>sample text
+					</strong>. You are using <a href="http://www.fckeditor.net">
+					FCKeditor</a>.
+				</jsp:attribute>
+			</FCK:editor>
+			<br />
+			<input type="submit" value="Submit" />
+		</form>
+	</body>
+</html>
Index: /FCKeditor.Java/branches/2.4/java-demo/src/main/webapp/jsp/sample05.jsp
===================================================================
--- /FCKeditor.Java/branches/2.4/java-demo/src/main/webapp/jsp/sample05.jsp	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-demo/src/main/webapp/jsp/sample05.jsp	(revision 1893)
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+	pageEncoding="UTF-8" %>
+<%@ taglib uri="http://www.fckeditor.net/tags" prefix="FCK" %>
+<%--
+ * 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 ==
+--%>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+	<head>
+		<title>FCKeditor - JSP Sample</title>
+		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+		<meta name="robots" content="noindex, nofollow" />
+		<link href="../sample.css" rel="stylesheet" type="text/css" />
+		<script type="text/javascript">
+			function FCKeditor_OnComplete(editorInstance) {
+				var oCombo = document.getElementById('cmbSkins') ;
+	
+				// Get the active skin.
+				var sSkin = editorInstance.Config['SkinPath'] ;
+				sSkin = sSkin.match( /[^\/]+(?=\/$)/g ) ;
+	
+				oCombo.value = sSkin ;
+				oCombo.style.visibility = '' ;
+			}
+
+			function ChangeSkin(skinName) {
+				window.location.href = window.location.pathname + "?skin=" + skinName ;
+			}
+		</script>
+	</head>
+	<%
+		String skinStr=request.getParameter("skin");
+		if(skinStr!=null) 
+			skinStr= "skins/" + skinStr + "/"; 	//basePath +  constant relative skin path + skinName
+		pageContext.setAttribute("skin",skinStr);
+	%>	
+	<body>
+		<h1>FCKeditor - JSP - Sample 5</h1>
+		This sample shows how to change the editor skin.
+		<hr />
+		<table cellpadding="0" cellspacing="0" border="0">
+			<tr>
+				<td>
+					Select the skin to load:&nbsp;
+				</td>
+				<td>
+					<select id="cmbSkins" onchange="ChangeSkin(this.value);" style="visibility: hidden">
+						<option value="default" selected="selected">Default</option>
+						<option value="office2003">Office 2003</option>
+						<option value="silver">Silver</option>
+					</select>
+				</td>
+			</tr>
+		</table>
+		<br />
+		<form action="sampleposteddata.jsp" method="get" target="_blank">
+			<FCK:editor instanceName="EditorDefault">
+				<jsp:attribute name="value">This is some <strong>sample text
+					</strong>. You are using <a href="http://www.fckeditor.net">
+					FCKeditor</a>.
+				</jsp:attribute>
+				<jsp:body>
+					<FCK:config SkinPath="${skin}"/>
+				</jsp:body>
+			</FCK:editor>
+			<br />
+			<input type="submit" value="Submit" />
+		</form>
+	</body>
+</html>
Index: /FCKeditor.Java/branches/2.4/java-demo/src/main/webapp/jsp/sample06.config.js
===================================================================
--- /FCKeditor.Java/branches/2.4/java-demo/src/main/webapp/jsp/sample06.config.js	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-demo/src/main/webapp/jsp/sample06.config.js	(revision 1893)
@@ -0,0 +1,42 @@
+/*
+ * 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 ==
+ */
+
+// Set our sample toolbar.
+FCKConfig.ToolbarSets['PluginTest'] = [
+	['Source'],
+	['My_Find','My_Replace','-','Placeholder'],
+	//['Table','-','TableInsertRow','TableDeleteRows','TableInsertColumn','TableDeleteColumns','TableInsertCell','TableDeleteCells','TableMergeCells','TableSplitCell'],
+	['Bold','Italic','-','OrderedList','UnorderedList','-','Link','Unlink','-','About']
+] ;
+
+// Change the default plugin path.
+FCKConfig.PluginsPath = FCKConfig.BasePath.substr(0, FCKConfig.BasePath.length - 7) + '_samples/_plugins/' ;
+
+// Add our plugin to the plugins list.
+//		FCKConfig.Plugins.Add( pluginName, availableLanguages )
+//			pluginName: The plugin name. The plugin directory must match this name.
+//			availableLanguages: a list of available language files for the plugin (separated by a comma).
+FCKConfig.Plugins.Add( 'findreplace', 'en,it' ) ;
+
+// If you want to use plugins found on other directories, just use the third parameter.
+var sOtherPluginPath = FCKConfig.BasePath.substr(0, FCKConfig.BasePath.length - 7) + 'editor/plugins/' ;
+FCKConfig.Plugins.Add( 'placeholder', 'en,it', sOtherPluginPath ) ;
+//FCKConfig.Plugins.Add( 'tablecommands', 'en,it', sOtherPluginPath ) ;
Index: /FCKeditor.Java/branches/2.4/java-demo/src/main/webapp/jsp/sample06.jsp
===================================================================
--- /FCKeditor.Java/branches/2.4/java-demo/src/main/webapp/jsp/sample06.jsp	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-demo/src/main/webapp/jsp/sample06.jsp	(revision 1893)
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+	pageEncoding="UTF-8" %>
+<%@ taglib uri="http://www.fckeditor.net/tags" prefix="FCK" %>
+<%--
+ * 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 ==
+--%>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+	<head>
+		<title>FCKeditor - Sample</title>
+		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+		<meta name="robots" content="noindex, nofollow" />
+		<link href="../sample.css" rel="stylesheet" type="text/css" />
+		<script type="text/javascript">
+			function FCKeditor_OnComplete(editorInstance) {
+				window.status = editorInstance.Description;
+			}
+		</script>
+	</head>
+	<body>
+		<h1>FCKeditor - JSP - Sample 6</h1>
+		This sample shows a sample plugin implementation.
+		<br />
+		These are sample "Find" and "Replace" plugin that do exactly the same 
+		thing that the built in ones do. Use the green toolbar buttons the test then.
+		<br />
+		There is also another sample plugin that is available in the package: 
+		the "Placeholder" command (use the yellow icon).
+		<hr />
+		<form action="sampleposteddata.jsp" method="post" target="_blank">
+			<FCK:editor instanceName="EditorDefault" toolbarSet="PluginTest">
+				<jsp:attribute name="value">This is some <strong>sample text
+					</strong>. You are using <a href="http://www.fckeditor.net">
+					FCKeditor</a>.
+				</jsp:attribute>
+				<jsp:body>
+					<FCK:config CustomConfigurationsPath="${pageContext.request.contextPath}/jsp/sample06.config.js" />
+				</jsp:body>
+			</FCK:editor>
+			<br />
+			<input type="submit" value="Submit" />
+		</form>
+	</body>
+</html>
Index: /FCKeditor.Java/branches/2.4/java-demo/src/main/webapp/jsp/sample07.jsp
===================================================================
--- /FCKeditor.Java/branches/2.4/java-demo/src/main/webapp/jsp/sample07.jsp	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-demo/src/main/webapp/jsp/sample07.jsp	(revision 1893)
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+	pageEncoding="UTF-8" %>
+<%@ taglib uri="http://www.fckeditor.net/tags" prefix="FCK" %>
+<%--
+ * 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 ==
+--%>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+	<head>
+		<title>FCKeditor - Sample</title>
+		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+		<meta name="robots" content="noindex, nofollow" />
+		<link href="../sample.css" rel="stylesheet" type="text/css" />
+		<script type="text/javascript">
+			function FCKeditor_OnComplete(editorInstance) {
+				window.status = editorInstance.Description;
+			}
+		</script>
+	</head><body>
+		<h1>FCKeditor - JSP - Sample 7</h1>
+		In this sample the user can edit the complete page contents and header (from 
+		&lt;HTML&gt; to &lt;/HTML&gt;).
+		<hr />
+		<form action="sampleposteddata.jsp" method="post" target="_blank">
+			<FCK:editor instanceName="EditorDefault">
+				<jsp:attribute name="value">
+					<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+						<html>
+							<head>
+								<title>Full Page Test</title>
+								<meta content="text/html; charset=utf-8" 
+									http-equiv="Content-Type"/>
+							</head>
+							<body>This is some <strong>sample text</strong>. You are 
+								using <a href="http://www.fckeditor.net/">FCKeditor
+								</a>.
+							</body>
+						</html>
+				</jsp:attribute>
+				<jsp:body>
+					<FCK:config FullPage="true"/>
+				</jsp:body>
+			</FCK:editor>
+			<br />
+			<input type="submit" value="Submit" />
+		</form>
+	</body>
+</html>
Index: /FCKeditor.Java/branches/2.4/java-demo/src/main/webapp/jsp/sampleposteddata.jsp
===================================================================
--- /FCKeditor.Java/branches/2.4/java-demo/src/main/webapp/jsp/sampleposteddata.jsp	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-demo/src/main/webapp/jsp/sampleposteddata.jsp	(revision 1893)
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+	pageEncoding="UTF-8" import="java.util.Enumeration;"%>
+<%--
+ * 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 ==
+--%>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+	<head>
+		<title>FCKeditor - Samples - Posted Data</title>
+		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+		<meta name="robots" content="noindex, nofollow" />
+		<link href="../sample.css" rel="stylesheet" type="text/css" />
+	</head>
+	<%
+		Enumeration<String> params = (Enumeration<String>) request.getParameterNames();
+	%>
+	<body>
+		<h1>FCKeditor - Samples - Posted Data</h1>
+		This page lists all data posted by the form.
+		<hr />
+		<table width="100%" border="1" cellspacing="0">
+			<tr style="FONT-WEIGHT: bold; COLOR: #dddddd; BACKGROUND-COLOR: #999999">
+				<td nowrap="nowrap">Field Name&nbsp;&nbsp;</td>
+				<td>Value</td>
+			</tr>
+			<%
+				String parameter;
+				while(params.hasMoreElements()) {
+					parameter = params.nextElement();
+			%>
+			<tr>
+				<td valign="top" nowrap="nowrap"><b><%=parameter%></b></td>
+				<td width="100%"><%=request.getParameter(parameter)%></td>
+			</tr>
+			<%
+				}
+			%>
+		</table>
+	</body>
+</html>
Index: /FCKeditor.Java/branches/2.4/java-demo/src/main/webapp/sample.css
===================================================================
--- /FCKeditor.Java/branches/2.4/java-demo/src/main/webapp/sample.css	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-demo/src/main/webapp/sample.css	(revision 1893)
@@ -0,0 +1,24 @@
+/* @Packager.Header
+<FileDescription>
+	Styles used in the samples pages.
+</FileDescription>
+*/
+
+body, td, input, select, textarea
+{
+	font-size: 12px;
+	font-family: Arial, Verdana, Sans-Serif;
+}
+
+h1
+{
+	font-weight: bold;
+	font-size: 180%;
+	margin-bottom: 10px;
+}
+
+form
+{
+	margin: 0px 0px 0px 0px;
+	padding: 0px 0px 0px 0px;
+}
Index: /FCKeditor.Java/branches/2.4/java-demo/src/main/webapp/sampleslist.jsp
===================================================================
--- /FCKeditor.Java/branches/2.4/java-demo/src/main/webapp/sampleslist.jsp	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-demo/src/main/webapp/sampleslist.jsp	(revision 1893)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+	pageEncoding="UTF-8"%>
+<%--
+ * 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 ==
+--%>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+	<head>
+		<title>FCKeditor - Sample Selection</title>
+		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+		<meta name="robots" content="noindex, nofollow" />
+		<link href="sample.css" rel="stylesheet" type="text/css" />
+		<script type="text/javascript">
+			if (window.top == window)
+				document.location = 'index.jsp' ;
+
+			function OpenSample(sample) {
+				if (sample.length > 0)
+					window.open( sample, 'Sample' );
+			}
+		</script>
+	</head>
+	<body>
+		<table border="0" cellpadding="0" cellspacing="0">
+			<tr>
+				<td>Please select the sample you want to view: <br />
+				<select onchange="OpenSample(this.value);">
+					<option value="jsp/sample01.jsp" selected="selected">
+					Sample 01: Editor with all features generated via API</option>
+					<option value="jsp/sample02.jsp">Sample 02: Editor with all 
+					features generated with JSP Taglib</option>
+					<option value="jsp/sample03.jsp">Sample 03:	Multi-language 
+					support</option>
+					<option value="jsp/sample04.jsp">Sample 04: Toolbar
+					selection</option>
+					<option value="jsp/sample05.jsp">Sample 05: Skins
+					support</option>
+					<option value="jsp/sample06.jsp">Sample 06: Plugins
+					support</option>
+					<option value="jsp/sample07.jsp">Sample 07: Full Page
+					editing</option>
+				</select></td>
+			</tr>
+		</table>
+	</body>
+</html>
Index: /FCKeditor.Java/branches/2.4/java-demo/src/site/resources/css/site.css
===================================================================
--- /FCKeditor.Java/branches/2.4/java-demo/src/site/resources/css/site.css	(revision 1893)
+++ /FCKeditor.Java/branches/2.4/java-demo/src/site/resources/css/site.css	(revision 1893)
@@ -0,0 +1,1 @@
+@import url(../../css/site.css);
Index: /FCKeditor.Java/branches/2.4/pom.xml
===================================================================
--- /FCKeditor.Java/branches/2.4/pom.xml	(revision 1892)
+++ /FCKeditor.Java/branches/2.4/pom.xml	(revision 1893)
@@ -7,5 +7,5 @@
 	<modelVersion>4.0.0</modelVersion>
 	<groupId>net.fckeditor</groupId>
-	<artifactId>fckeditor-java-parent</artifactId>
+	<artifactId>fckeditor-java</artifactId>
 	<version>2.4-SNAPSHOT</version>
 	<packaging>pom</packaging>
@@ -28,6 +28,6 @@
 	</dependencies>
 	<modules>
-		<module>fckeditor-java</module>
-		<module>fckeditor-java-demo</module>
+		<module>java-core</module>
+		<module>java-demo</module>
 	</modules>
 	<build>
@@ -209,10 +209,9 @@
 	</reporting>
 
-	<name>FCKeditor.Java Integration Parent</name>
+	<name>FCKeditor.Java Integration</name>
 	<description>
-		The FCKeditor.Java Integration Parent fosters the entire project
-		documentation, the Java library, and a drop-in demo webapp. All three
-		depict and enable you to learn and to integrate the FCKeditor in your
-		web environment.
+		The FCKeditor.Java Integration fosters the entire project documentation,
+		the Java library, and a drop-in demo webapp. All three depict and enable
+		you to learn and to integrate the FCKeditor in your web environment.
 	</description>
 	<url>http://www.fckeditor.net/java</url>
