Interface MultiPart.Parser.Listener

All Known Implementing Classes:
MultiPart.AbstractPartsListener
Enclosing class:
MultiPart.Parser

public static interface MultiPart.Parser.Listener

A listener for events emitted by a MultiPart.Parser.

  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Callback method invoked when the whole multipart content has been parsed.
    default void
    Callback method invoked when the parser cannot parse the multipart content.
    default void
    Callback method invoked when the begin of a new part is parsed.
    default void
    Callback method invoked when a part content Chunk has been parsed.
    default void
    Callback method invoked when the end of a part is parsed.
    default void
    onPartHeader(String name, String value)
    Callback method invoked when a part header is parsed.
    default void
    Callback method invoked when all the part headers have been parsed.
    default void
    Callback method invoked when the low level parser encounters a fundamental multipart violation
  • Method Details

    • onPartBegin

      default void onPartBegin()

      Callback method invoked when the begin of a new part is parsed.

    • onPartHeader

      default void onPartHeader(String name, String value)

      Callback method invoked when a part header is parsed.

      Parameters:
      name - the header name
      value - the header value
    • onPartHeaders

      default void onPartHeaders()

      Callback method invoked when all the part headers have been parsed.

    • onPartContent

      default void onPartContent(Content.Chunk chunk)

      Callback method invoked when a part content Chunk has been parsed.

      The Chunk must be Retainable.retain() retained} if it not consumed by this method (for example, stored away for later use).

      Parameters:
      chunk - the part content chunk
    • onPartEnd

      default void onPartEnd()

      Callback method invoked when the end of a part is parsed.

    • onComplete

      default void onComplete()

      Callback method invoked when the whole multipart content has been parsed.

    • onFailure

      default void onFailure(Throwable failure)

      Callback method invoked when the parser cannot parse the multipart content.

      Parameters:
      failure - the failure cause
    • onViolation

      default void onViolation(MultiPartCompliance.Violation violation)

      Callback method invoked when the low level parser encounters a fundamental multipart violation

      >
      Parameters:
      violation - the violation detected