# Class CARequestLimits

java.lang.Object
com.io7m.cardant.server.service.reqlimit.CARequestLimits

All Implemented Interfaces:
  `com.io7m.repetoir.core.RPServiceType`

public final class CARequestLimits extends Object implements com.io7m.repetoir.core.RPServiceType
Methods to handle request size limits.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CARequestLimits(CAConfigurationServiceType inConfigService, Function<Long,String> inRequestTooLargeMessage)`
  Methods to handle request size limits.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `InputStream`
  `boundedMaximumInput(io.helidon.webserver.http.ServerRequest request, long maximum)`
  Bound the given servlet request to the given maximum size, raising an exception if the incoming Content-Length is larger than this size.
  `InputStream`
  `boundedMaximumInputForFileUpload(io.helidon.webserver.http.ServerRequest request)`
  Bound the given servlet request to a maximum size suitable for file uploads, raising an exception if the incoming Content-Length is larger than this size.
  `InputStream`
  `boundedMaximumInputForLoginCommand(io.helidon.webserver.http.ServerRequest request)`
  Bound the given servlet request to a maximum size suitable for login commands, raising an exception if the incoming Content-Length is larger than this size.
  `String`
  `description()`
  `String`
  `toString()`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### CARequestLimits

    public CARequestLimits(CAConfigurationServiceType inConfigService, Function<Long,String> inRequestTooLargeMessage)
    Methods to handle request size limits.
    Parameters:
      `inConfigService` - The configuration service
      `inRequestTooLargeMessage` - A function that formats a message

- ## Method Details

  - ### boundedMaximumInput

    public InputStream boundedMaximumInput(io.helidon.webserver.http.ServerRequest request, long maximum) throws CARequestLimitExceeded
    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:
      `CARequestLimitExceeded` - On errors

  - ### description

    public String description()
    Specified by:
      `description` in interface `com.io7m.repetoir.core.RPServiceType`

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### boundedMaximumInputForFileUpload

    public InputStream boundedMaximumInputForFileUpload(io.helidon.webserver.http.ServerRequest request) throws CARequestLimitExceeded
    Bound the given servlet request to a maximum size suitable for file uploads, raising an exception if the incoming Content-Length is larger than this size.
    Parameters:
      `request` - The request
    Returns:
      A bounded input stream
    Throws:
      `CARequestLimitExceeded` - On errors

  - ### boundedMaximumInputForLoginCommand

    public InputStream boundedMaximumInputForLoginCommand(io.helidon.webserver.http.ServerRequest request) throws CARequestLimitExceeded
    Bound the given servlet request to a maximum size suitable for login commands, raising an exception if the incoming Content-Length is larger than this size.
    Parameters:
      `request` - The request
    Returns:
      A bounded input stream
    Throws:
      `CARequestLimitExceeded` - On errors