com.fredck.FCKeditor.connector
Class ConnectorServlet
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
com.fredck.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 used to retrieve and create files and folders from a server directory.
The allowed commands are:
- GetFolders: Retrive the list of directory under the current folder
- GetFoldersAndFiles: Retrive the list of files and directory under the current folder
- CreateFolder: Create a new directory under the current folder
- FileUpload: Send a new file to the server (must be sent with a POST)
- Author:
- Simone Chiaretta (simone@piyosailing.com)
- See Also:
- Serialized Form
Method Summary |
void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Manage the Get requests (GetFolders, GetFoldersAndFiles, CreateFolder). |
void |
doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Manage the Post requests (FileUpload). |
void |
init()
Initialize the servlet. |
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 |
ConnectorServlet
public ConnectorServlet()
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.
- Throws:
javax.servlet.ServletException
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 execute the command and then return the results to the client in XML format.
- 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
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.
- Throws:
javax.servlet.ServletException
java.io.IOException