Class IdRequestLimits

java.lang.Object
com.io7m.idstore.server.service.reqlimit.IdRequestLimits
All Implemented Interfaces:
IdServiceType

public final class IdRequestLimits extends Object implements IdServiceType
Methods to handle request size limits.
  • Constructor Details

    • IdRequestLimits

      public IdRequestLimits(Function<Long,String> inRequestTooLargeMessage)
      Methods to handle request size limits.
      Parameters:
      inRequestTooLargeMessage - A function that formats a message
  • Method Details

    • boundedMaximumInput

      public InputStream boundedMaximumInput(jakarta.servlet.http.HttpServletRequest request, int maximum) throws IOException, IdRequestLimitExceeded
      Bound the given servlet request to the given maximum size, raising an exception if the incoming Content-Length is larger than this size.
      Parameters:
      request - The request
      maximum - The maximum size
      Returns:
      A bounded input stream
      Throws:
      IOException - On errors
      IdRequestLimitExceeded - On errors
    • description

      public String description()
      Specified by:
      description in interface IdServiceType
      Returns:
      The service description
    • toString

      public String toString()
      Overrides:
      toString in class Object