info.magnolia.module.fckeditor.servlets
Class FCKEditorSimpleUploadServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by info.magnolia.module.fckeditor.servlets.FCKEditorSimpleUploadServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class FCKEditorSimpleUploadServlet
extends javax.servlet.http.HttpServlet

Servlet to upload files. This is based on the SimpleUploaderServlet of the FCKeditor connector package. This servlet just accepts file uploads, with an optional file type parameter.

Author:
Simone Chiaretta (simo@users.sourceforge.net), Philipp Bracher
See Also:
Serialized Form

Constructor Summary
FCKEditorSimpleUploadServlet()
           
 
Method Summary
 void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Manage the Upload requests.
The servlet accepts commands sent in the following format:
simpleUploader?Type=ResourceType

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.
 void init()
          Initialize the servlet.
Retrieve from the servlet configuration the "baseDir" which is the root of the file repository:
If not specified the value of "/UserFiles/" will be used.
Also it retrieve all allowed and denied extensions to be handled.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FCKEditorSimpleUploadServlet

public FCKEditorSimpleUploadServlet()
Method Detail

init

public void init()
          throws javax.servlet.ServletException
Initialize the servlet.
Retrieve from the servlet configuration the "baseDir" which is the root of the file repository:
If not specified the value of "/UserFiles/" will be used.
Also it retrieve all allowed and denied extensions to be handled.

Overrides:
init in class javax.servlet.GenericServlet
Throws:
javax.servlet.ServletException

doPost

public void doPost(javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response)
            throws javax.servlet.ServletException,
                   IOException
Manage the Upload requests.
The servlet accepts commands sent in the following format:
simpleUploader?Type=ResourceType

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.

Overrides:
doPost in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
IOException


Copyright © 2003-2011 Magnolia International Ltd.. All Rights Reserved.