Package dap4.servlet

Class DapRequest


  • public class DapRequest
    extends Object
    User requests get cached here so that downstream code can access the details of the request information.

    Modified by Heimbigner for DAP4.

    • Field Detail

      • DEFAULTCSUM

        public static final dap4.core.data.ChecksumMode DEFAULTCSUM
      • request

        protected javax.servlet.http.HttpServletRequest request
      • response

        protected javax.servlet.http.HttpServletResponse response
      • querystring

        protected String querystring
      • server

        protected String server
      • controllerpath

        protected String controllerpath
      • datasetpath

        protected String datasetpath
      • mode

        protected dap4.dap4lib.RequestMode mode
      • format

        protected dap4.core.util.ResponseFormat format
      • checksummode

        protected dap4.core.data.ChecksumMode checksummode
      • resourceroot

        protected String resourceroot
      • servletcontext

        protected javax.servlet.ServletContext servletcontext
    • Constructor Detail

      • DapRequest

        public DapRequest​(DapController controller,
                          javax.servlet.http.HttpServletRequest request,
                          javax.servlet.http.HttpServletResponse response)
                   throws dap4.core.util.DapException
        Throws:
        dap4.core.util.DapException
    • Method Detail

      • parse

        protected void parse()
                      throws IOException
        The goal of parse() is to extract info from the underlying HttpRequest and cache it in this object.

        In particular, the incoming URL needs to be decomposed into multiple pieces. Certain assumptions are made: 1. every incoming url is of the form (a) http(s)://host:port/d4ts/ or (b) http(s)://host:port/d4ts/?query Case a indicates that the front page is to be returned. Case b indicates a request for a dataset (or dsr), and its value is determined by its extensions. The query may be absent. We want to extract the following pieces. 1. (In URI parlance) The scheme plus the authority: http://host:port 3. The return type: depending on the last extension (e.g. ".txt"). 4. The requested value: depending on the next to last extension (e.g. ".dap"). 5. The suffix path specifying the actual dataset: datasetpath with return and request type extensions removed. 6. The url path = servletpath + datasetpath. 7. The query part.

        Throws:
        IOException
      • getResourceRoot

        public String getResourceRoot()
      • getChecksumMode

        public dap4.core.data.ChecksumMode getChecksumMode()
      • getRequest

        public javax.servlet.http.HttpServletRequest getRequest()
      • getResponse

        public javax.servlet.http.HttpServletResponse getResponse()
      • getURL

        public String getURL()
      • getOriginalURL

        public String getOriginalURL()
      • getDataset

        public String getDataset()
      • getServer

        public String getServer()
      • getServletContext

        public javax.servlet.ServletContext getServletContext()
      • getControllerPath

        public String getControllerPath()
      • getURLPath

        public String getURLPath()
      • getMode

        public dap4.dap4lib.RequestMode getMode()
      • getFormat

        public dap4.core.util.ResponseFormat getFormat()
      • setResponseHeader

        public void setResponseHeader​(String name,
                                      String value)
        Set a request header
        Parameters:
        name - the header name
        value - the header value
      • getDatasetPath

        public String getDatasetPath()