Interface TusExtension

All Known Implementing Classes:
AbstractTusExtension, ChecksumExtension, ConcatenationExtension, CoreProtocol, CreationExtension, DownloadExtension, ExpirationExtension, TerminationExtension

public interface TusExtension
Interface that represents an extension in the tus protocol
  • Method Details

    • getName

      String getName()
      The name of the Tus extension that can be used to disable or enable the extension
      Returns:
      The name of the extension
    • validate

      void validate(HttpMethod method, jakarta.servlet.http.HttpServletRequest servletRequest, UploadStorageService uploadStorageService, String ownerKey) throws TusException, IOException
      Validate the given request
      Parameters:
      method - The HTTP method of this request (taking into account overrides)
      servletRequest - The HTTP request
      uploadStorageService - The current upload storage service
      ownerKey - Identifier of the owner of this upload
      Throws:
      TusException - When the request is invalid
      IOException - When unable to read upload information
    • process

      void process(HttpMethod method, TusServletRequest servletRequest, TusServletResponse servletResponse, UploadStorageService uploadStorageService, String ownerKey) throws IOException, TusException
      Process the given request
      Parameters:
      method - The HTTP method of this request (taking into account overrides)
      servletRequest - The HTTP request
      servletResponse - The HTTP response
      uploadStorageService - The current upload storage service
      ownerKey - Identifier of the owner of this upload
      Throws:
      TusException - When processing the request fails
      IOException - When unable to read upload information
    • handleError

      void handleError(HttpMethod method, TusServletRequest servletRequest, TusServletResponse servletResponse, UploadStorageService uploadStorageService, String ownerKey) throws IOException, TusException
      If a request is invalid, or when processing the request fails, it might be necessary to react to this failure. This method allows extensions to react to validation or processing failures.
      Parameters:
      method - The HTTP method of this request (taking into account overrides)
      servletRequest - The HTTP request
      servletResponse - The HTTP response
      uploadStorageService - The current upload storage service
      ownerKey - Identifier of the owner of this upload
      Throws:
      TusException - When handling the error fails
      IOException - When unable to read upload information
    • getMinimalSupportedHttpMethods

      Collection<HttpMethod> getMinimalSupportedHttpMethods()
      The minimal list of HTTP methods that this extension needs to function properly
      Returns:
      The list of HTTP methods required by this extension