Class Texter

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

    @WebServlet(name="Texter",
                urlPatterns={"/Texter/*","/servlet/Texter/*"})
    public class Texter
    extends javax.servlet.http.HttpServlet
    Servlet for displaying text
    Author:
    casties
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      Texter()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void doGet​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)  
      protected void doPost​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)  
      protected TextFile getTextFile​(DigilibServletRequest dlRequest, String subDirectory)
      Looks for a file in the given subDirectory.
      void init​(javax.servlet.ServletConfig config)  
      protected void processRequest​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)  
      • 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
    • Field Detail

      • tlVersion

        public static String tlVersion
        Servlet version
      • logger

        protected org.slf4j.Logger logger
        general logger
      • accountlog

        protected static org.slf4j.Logger accountlog
        logger for accounting requests
      • fileOp

        protected FileOps fileOp
        FileOps instance
      • authzOp

        protected AuthzOps authzOp
        AuthOps instance
      • dirCache

        protected DocuDirCache dirCache
        DocuDirCache instance
      • useAuthorization

        protected boolean useAuthorization
        use authentication
      • defaultDir

        protected String defaultDir
        default text directory
    • Constructor Detail

      • Texter

        public Texter()
    • Method Detail

      • init

        public void init​(javax.servlet.ServletConfig config)
                  throws javax.servlet.ServletException
        Specified by:
        init in interface javax.servlet.Servlet
        Overrides:
        init in class javax.servlet.GenericServlet
        Throws:
        javax.servlet.ServletException
      • doGet

        protected void doGet​(javax.servlet.http.HttpServletRequest request,
                             javax.servlet.http.HttpServletResponse response)
                      throws javax.servlet.ServletException,
                             IOException
        Overrides:
        doGet in class javax.servlet.http.HttpServlet
        Throws:
        javax.servlet.ServletException
        IOException
      • doPost

        protected void doPost​(javax.servlet.http.HttpServletRequest request,
                              javax.servlet.http.HttpServletResponse response)
                       throws javax.servlet.ServletException,
                              IOException
        Overrides:
        doPost in class javax.servlet.http.HttpServlet
        Throws:
        javax.servlet.ServletException
        IOException
      • processRequest

        protected void processRequest​(javax.servlet.http.HttpServletRequest request,
                                      javax.servlet.http.HttpServletResponse response)
      • getTextFile

        protected TextFile getTextFile​(DigilibServletRequest dlRequest,
                                       String subDirectory)
        Looks for a file in the given subDirectory.
        Parameters:
        dlRequest - The received request which has the file path.
        subDirectory - The subDirectory of the file path where the file should be found.
        Returns:
        The wanted Textfile or null if there wasn't a file.