Class MediaDeliveryService

java.lang.Object
io.goobi.viewer.api.rest.model.MediaDeliveryService

public class MediaDeliveryService extends Object
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 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 serve
      mimeType - MIME type for the Content-Type header
      Throws:
      IOException - if any.
    • matchesRangeHeaderPattern

      protected static boolean matchesRangeHeaderPattern(String range)
      Parameters:
      range - raw value of the HTTP Range header to validate
      Returns:
      true if range matches pattern; false otherwise