org.mycore.frontend.fileupload
Class MCRUploadServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.mycore.frontend.servlets.MCRServlet
              extended by org.mycore.frontend.fileupload.MCRUploadServlet
All Implemented Interfaces:
Serializable, Runnable, Servlet, ServletConfig

public final class MCRUploadServlet
extends MCRServlet
implements Runnable

This servlet implements the server side of communication with the upload applet. The content of the uploaded files are handled by a MCRUploadHandler subclass.

Version:
$Revision: 15202 $ $Date: 2009-05-15 17:00:44 +0200 (Fri, 15 May 2009) $
Author:
Frank Lützenkirchen, Harald Richter, Thomas Scheffler (yagee)
See Also:
MCRUploadHandler, Serialized Form

Field Summary
(package private) static int bufferSize
           
(package private) static Logger LOGGER
           
(package private) static ServerSocket server
           
(package private) static String serverIP
           
(package private) static int serverPort
           
(package private) static MCRCache sessionIDs
           
 
Fields inherited from class org.mycore.frontend.servlets.MCRServlet
BASE_URL_ATTRIBUTE, trustedProxies
 
Constructor Summary
MCRUploadServlet()
           
 
Method Summary
 void doGetPost(MCRServletJob job)
          This method should be overwritten by other servlets.
 void finalize()
           
protected  String getFileName(String path)
           
 void handleUpload(Socket socket)
           
 void init()
           
protected  void invokeMethod(MCRServletJob job)
           
 void run()
           
protected  void sendException(HttpServletResponse res, Exception ex)
           
protected  void sendResponse(HttpServletResponse res, Object value)
           
protected  void sendResponse(HttpServletResponse res, String mime, Map parameters)
           
 
Methods inherited from class org.mycore.frontend.servlets.MCRServlet
buildRedirectURL, doGet, doGet, doPost, doPost, generateActiveLinkErrorpage, generateErrorPage, getBaseURL, getLastModified, getLayoutService, getProperty, getRemoteAddr, getServletBaseURL, getSession, handleException, initTrustedProxies, render, reportException, think
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, 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, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serverIP

static String serverIP

serverPort

static int serverPort

server

static ServerSocket server

LOGGER

static Logger LOGGER

sessionIDs

static MCRCache sessionIDs

bufferSize

static final int bufferSize
See Also:
Constant Field Values
Constructor Detail

MCRUploadServlet

public MCRUploadServlet()
Method Detail

init

public void init()
          throws ServletException
Overrides:
init in class MCRServlet
Throws:
ServletException

finalize

public void finalize()
              throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable

handleUpload

public void handleUpload(Socket socket)

run

public void run()
Specified by:
run in interface Runnable

doGetPost

public void doGetPost(MCRServletJob job)
               throws Exception
Description copied from class: MCRServlet
This method should be overwritten by other servlets. As a default response we indicate the HTTP 1.1 status code 501 (Not Implemented).

Overrides:
doGetPost in class MCRServlet
Throws:
Exception

invokeMethod

protected void invokeMethod(MCRServletJob job)
                     throws Exception
Throws:
Exception

getFileName

protected String getFileName(String path)

sendException

protected void sendException(HttpServletResponse res,
                             Exception ex)
                      throws Exception
Throws:
Exception

sendResponse

protected void sendResponse(HttpServletResponse res,
                            Object value)
                     throws Exception
Throws:
Exception

sendResponse

protected void sendResponse(HttpServletResponse res,
                            String mime,
                            Map parameters)
                     throws Exception
Throws:
Exception