net.fckeditor.connector
Class ConnectorServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by net.fckeditor.connector.ConnectorServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class ConnectorServlet
extends javax.servlet.http.HttpServlet

Servlet to upload and browse files.
This servlet accepts 4 commands which interact with the server-side filesystem.
The allowed commands are:

Version:
$Id: ConnectorServlet.java 3840 2009-07-08 20:29:46Z mosipov $
See Also:
Serialized Form

Constructor Summary
ConnectorServlet()
           
 
Method Summary
 void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Manage the GET requests (GetFolders, GetFoldersAndFiles, CreateFolder).
The servlet accepts commands sent in the following format:
connector?Command=<CommandName>&Type=<ResourceType>&CurrentFolder=<FolderPath>
 void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Manage the POST requests (FileUpload).
The servlet accepts commands sent in the following format:
connector?Command=<FileUpload>&Type=<ResourceType>&CurrentFolder=<FolderPath> with the file in the POST body.

It stores an uploaded file (renames a file if another exists with the same name) and then returns the JavaScript callback.
 void init()
          Initialize the servlet: mkdir <DefaultUserFilesPath>
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, 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

ConnectorServlet

public ConnectorServlet()
Method Detail

init

public void init()
          throws javax.servlet.ServletException,
                 java.lang.IllegalArgumentException
Initialize the servlet: mkdir <DefaultUserFilesPath>

Overrides:
init in class javax.servlet.GenericServlet
Throws:
javax.servlet.ServletException
java.lang.IllegalArgumentException

doGet

public void doGet(javax.servlet.http.HttpServletRequest request,
                  javax.servlet.http.HttpServletResponse response)
           throws javax.servlet.ServletException,
                  java.io.IOException
Manage the GET requests (GetFolders, GetFoldersAndFiles, CreateFolder).
The servlet accepts commands sent in the following format:
connector?Command=<CommandName>&Type=<ResourceType>&CurrentFolder=<FolderPath>

It executes the commands and then returns the result to the client in XML format.

Overrides:
doGet in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
java.io.IOException

doPost

public void doPost(javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response)
            throws javax.servlet.ServletException,
                   java.io.IOException
Manage the POST requests (FileUpload).
The servlet accepts commands sent in the following format:
connector?Command=<FileUpload>&Type=<ResourceType>&CurrentFolder=<FolderPath> with the file in the POST body.

It stores an uploaded file (renames a file if another exists with the same name) and then returns the JavaScript callback.

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


Copyright © 2004-2009 Frederico Caldeira Knabben. All Rights Reserved.