Package io.goobi.viewer.api.rest.model
Class MediaDeliveryService
java.lang.Object
io.goobi.viewer.api.rest.model.MediaDeliveryService
Service class that handles HTTP file delivery with support for byte-range requests, conditional caching headers (ETag, If-Modified-Since), and
optional GZIP encoding for text content.
Processes full-file as well as single- and multi-part partial-content (HTTP 206) responses.
- Author:
- Florian Alpers
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static booleanmatchesRangeHeaderPattern(String range) voidprocessRequest(HttpServletRequest request, HttpServletResponse response, String filePath, String mimeType) Processes the actual request.
-
Constructor Details
-
MediaDeliveryService
public MediaDeliveryService()
-
-
Method Details
-
processRequest
public void processRequest(HttpServletRequest request, HttpServletResponse response, String filePath, String mimeType) throws IOException Processes the actual request.- Parameters:
request- The request to be processed.response- The response to be created.filePath- absolute path to the file to servemimeType- MIME type for the Content-Type header- Throws:
IOException- if any.
-
matchesRangeHeaderPattern
- Parameters:
range- raw value of the HTTP Range header to validate- Returns:
- true if range matches pattern; false otherwise
-