Class DapRequest
Modified by Heimbigner for DAP4.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected dap4.core.util.ChecksumModeprotected DapControllerprotected Stringprotected Stringprotected dap4.core.util.ResponseFormatprotected dap4.dap4lib.RequestModeprotected ByteOrderprotected jakarta.servlet.http.HttpServletRequestprotected static final Stringprotected jakarta.servlet.http.HttpServletResponseprotected static final Stringprotected dap4.core.util.XURI -
Constructor Summary
ConstructorsConstructorDescriptionDapRequest(DapController controller, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) -
Method Summary
Modifier and TypeMethodDescriptiondap4.core.util.ChecksumModedap4.core.util.ResponseFormatdap4.dap4lib.RequestModegetMode()getOrder()jakarta.servlet.http.HttpServletRequestjakarta.servlet.http.HttpServletResponsegetURL()getWebContentPath(String location) Convert a URL path for a web-content related file into an absolute file pathprotected voidparseURI()The goal of parse() is to extract info from the underlying HttpRequest and cache it in this object.queryLookup(String name) voidsetResponseHeader(String name, String value) Set a request header
-
Field Details
-
WEBINFPATH
- See Also:
-
RESOURCEDIRNAME
- See Also:
-
controller
-
request
protected jakarta.servlet.http.HttpServletRequest request -
response
protected jakarta.servlet.http.HttpServletResponse response -
xuri
protected dap4.core.util.XURI xuri -
mode
protected dap4.dap4lib.RequestMode mode -
format
protected dap4.core.util.ResponseFormat format -
order
-
checksummode
protected dap4.core.util.ChecksumMode checksummode -
datasetpath
-
dataset
-
-
Constructor Details
-
DapRequest
public DapRequest(DapController controller, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws dap4.core.util.DapException - Throws:
dap4.core.util.DapException
-
-
Method Details
-
parseURI
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
-
getOrder
-
getChecksumMode
public dap4.core.util.ChecksumMode getChecksumMode() -
getRequest
public jakarta.servlet.http.HttpServletRequest getRequest() -
getResponse
public jakarta.servlet.http.HttpServletResponse getResponse() -
getWebContentRoot
- Throws:
dap4.core.util.DapException
-
getServletID
- Throws:
dap4.core.util.DapException
-
getWebContentPath
Convert a URL path for a web-content related file into an absolute file path- Parameters:
location- suffix of url path- Returns:
- path in a string builder so caller can extend.
- Throws:
IOExceptiondap4.core.util.DapException
-
getOutputStream
- Throws:
IOException
-
getURL
-
getDatasetPath
-
getDataset
-
getMode
public dap4.dap4lib.RequestMode getMode() -
getFormat
public dap4.core.util.ResponseFormat getFormat() -
setResponseHeader
Set a request header- Parameters:
name- the header namevalue- the header value
-
queryLookup
-
getQueries
-