类 PartGenerator.State

java.lang.Object
cn.taketoday.http.codec.multipart.PartGenerator.State
直接已知子类:
PartGenerator.CreateFileState, PartGenerator.DisposedState, PartGenerator.FormFieldState, PartGenerator.IdleFileState, PartGenerator.InitialState, PartGenerator.InMemoryState, PartGenerator.StreamingState, PartGenerator.WritingFileState
封闭类:
PartGenerator

private abstract static class PartGenerator.State extends Object
Represents the internal state of the PartGenerator for creating a single Part. PartGenerator.State instances are stateful, and created when a new MultipartParser.HeadersToken is accepted (see PartGenerator.newPart(State, HttpHeaders). The following rules determine which state the creator will have:
  1. If the part is a form field, the creator will be in the PartGenerator.FormFieldState.
  2. If PartGenerator.streaming is enabled, the creator will be in the PartGenerator.StreamingState.
  3. Otherwise, the creator will initially be in the PartGenerator.InMemoryState, but will switch over to PartGenerator.CreateFileState when the part byte count exceeds PartGenerator.maxInMemorySize, then to PartGenerator.WritingFileState (to write the memory contents), and finally PartGenerator.IdleFileState, which switches back to PartGenerator.WritingFileState when more body data comes in.
  • 构造器详细资料

    • State

      private State()
  • 方法详细资料

    • applyBody

      abstract void applyBody(cn.taketoday.core.io.buffer.DataBuffer dataBuffer)
      Invoked when a MultipartParser.BodyToken is received.
    • onComplete

      void onComplete()
      Invoked when all tokens for the part have been received.
    • error

      void error(Throwable throwable)
      Invoked when an error has been received.
    • dispose

      void dispose()
      Cleans up any state.