Class UploadServlet

  • All Implemented Interfaces:
    java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

    public class UploadServlet
    extends javax.servlet.http.HttpServlet
    Entry point for all data data upload related steps, supports POST and PUT Add custom steps in web.xml in the following format: Steps MY_STEP_NAME: de.my.package.ClassName; MY_STEP_NAME2: de.my.package.ClassName2; Such Steps - need a Constructor getting (UploadControl uc, String userId) - implement IUploadStep - if writing, call UploadControl#addStepResult() at the end of their process()
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      UploadServlet()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static java.sql.Connection getControlConnection()  
      protected java.lang.String getMultipartParam​(javax.servlet.http.Part part, java.lang.String paramName)
      Retrieve the filename of the data upload file from http header
      static java.lang.String getTransformSQL​(java.lang.String sql)  
      protected java.lang.String getUserId()  
      void init()  
      protected void service​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
      Receives an data upload file and creates an entry in bcd_dataupload_control
      • Methods inherited from class javax.servlet.http.HttpServlet

        doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, 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
    • Field Detail

      • PARAM_NAME_UPLOADID

        public static final java.lang.String PARAM_NAME_UPLOADID
        See Also:
        Constant Field Values
      • PARAM_NAME_STEPS

        public static final java.lang.String PARAM_NAME_STEPS
        See Also:
        Constant Field Values
      • PARAM_NAME_TARGETBS

        public static final java.lang.String PARAM_NAME_TARGETBS
        See Also:
        Constant Field Values
      • PARAM_NAME_DELETE

        public static final java.lang.String PARAM_NAME_DELETE
        See Also:
        Constant Field Values
      • PARAM_STEPS_SEPARATOR

        public static final java.lang.String PARAM_STEPS_SEPARATOR
        See Also:
        Constant Field Values
      • INIT_PARAM_STEPS

        public static final java.lang.String INIT_PARAM_STEPS
        See Also:
        Constant Field Values
      • PARAM_NAME_FILENAME

        public static final java.lang.String PARAM_NAME_FILENAME
        See Also:
        Constant Field Values
      • stepImpls

        protected java.util.Map<java.lang.String,​java.lang.Class<? extends IUploadStep>> stepImpls
    • Constructor Detail

      • UploadServlet

        public UploadServlet()
    • Method Detail

      • service

        protected void service​(javax.servlet.http.HttpServletRequest request,
                               javax.servlet.http.HttpServletResponse response)
                        throws javax.servlet.ServletException
        Receives an data upload file and creates an entry in bcd_dataupload_control
        Overrides:
        service in class javax.servlet.http.HttpServlet
        Parameters:
        request -
        response -
        Throws:
        javax.servlet.ServletException
      • getUserId

        protected java.lang.String getUserId()
        Returns:
        userId (or a predefined string ANONYMOUS_ID) if no user is known
      • getMultipartParam

        protected java.lang.String getMultipartParam​(javax.servlet.http.Part part,
                                                     java.lang.String paramName)
        Retrieve the filename of the data upload file from http header
        Parameters:
        part -
        paramName -
        Returns:
      • init

        public void init()
                  throws javax.servlet.ServletException
        Overrides:
        init in class javax.servlet.GenericServlet
        Throws:
        javax.servlet.ServletException
      • getTransformSQL

        public static java.lang.String getTransformSQL​(java.lang.String sql)
      • getControlConnection

        public static java.sql.Connection getControlConnection()
                                                        throws java.lang.Exception
        Throws:
        java.lang.Exception