Class AbstractTusExtension

java.lang.Object
me.desair.tus.server.util.AbstractTusExtension
All Implemented Interfaces:
TusExtension
Direct Known Subclasses:
ChecksumExtension, ConcatenationExtension, CoreProtocol, CreationExtension, DownloadExtension, ExpirationExtension, TerminationExtension

public abstract class AbstractTusExtension extends Object implements TusExtension
  • Constructor Details

    • AbstractTusExtension

      public AbstractTusExtension()
  • Method Details

    • initValidators

      protected abstract void initValidators(List<RequestValidator> requestValidators)
    • initRequestHandlers

      protected abstract void initRequestHandlers(List<RequestHandler> requestHandlers)
    • validate

      public void validate(HttpMethod method, jakarta.servlet.http.HttpServletRequest servletRequest, UploadStorageService uploadStorageService, String ownerKey) throws TusException, IOException
      Description copied from interface: TusExtension
      Validate the given request
      Specified by:
      validate in interface TusExtension
      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

      public void process(HttpMethod method, TusServletRequest servletRequest, TusServletResponse servletResponse, UploadStorageService uploadStorageService, String ownerKey) throws IOException, TusException
      Description copied from interface: TusExtension
      Process the given request
      Specified by:
      process in interface TusExtension
      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:
      IOException - When unable to read upload information
      TusException - When processing the request fails
    • handleError

      public void handleError(HttpMethod method, TusServletRequest request, TusServletResponse response, UploadStorageService uploadStorageService, String ownerKey) throws IOException, TusException
      Description copied from interface: TusExtension
      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.
      Specified by:
      handleError in interface TusExtension
      Parameters:
      method - The HTTP method of this request (taking into account overrides)
      request - The HTTP request
      response - The HTTP response
      uploadStorageService - The current upload storage service
      ownerKey - Identifier of the owner of this upload
      Throws:
      IOException - When unable to read upload information
      TusException - When handling the error fails