Class UploadDeferLengthValidator

java.lang.Object
me.desair.tus.server.creation.validation.UploadDeferLengthValidator
All Implemented Interfaces:
RequestValidator

public class UploadDeferLengthValidator extends Object implements RequestValidator
The request MUST include one of the following headers: a) Upload-Length to indicate the size of an entire upload in bytes. b) Upload-Defer-Length: 1 if upload size is not known at the time.
  • Constructor Details

    • UploadDeferLengthValidator

      public UploadDeferLengthValidator()
  • Method Details

    • validate

      public void validate(HttpMethod method, jakarta.servlet.http.HttpServletRequest request, UploadStorageService uploadStorageService, String ownerKey) throws TusException
      Description copied from interface: RequestValidator
      Validate if the request should be processed
      Specified by:
      validate in interface RequestValidator
      Parameters:
      method - The HTTP method of this request (do not use HttpServletRequest.getMethod()!)
      request - The HttpServletRequest to validate
      uploadStorageService - The current upload storage service
      ownerKey - A key representing the owner of the upload
      Throws:
      TusException - When validation fails and the request should not be processed
    • supports

      public boolean supports(HttpMethod method)
      Description copied from interface: RequestValidator
      Test if this validator supports the given HTTP method
      Specified by:
      supports in interface RequestValidator
      Parameters:
      method - The current HTTP method
      Returns:
      true if supported, false otherwise