Class PartEntryFactory

java.lang.Object
org.simpleframework.http.message.PartEntryFactory

class PartEntryFactory extends Object
This PartEntryFactory object provides a factory for creating part entry consumers. The part entry consumers created read individual entries from a list of parts within a stream. This is basically a convenience factory for the list consumer.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final Allocator
    This is used to allocate the buffers used by the entry.
    private final long
    This is the length of the parent part series body.
    private final PartSeries
    This is used to accumulate all the parts of the upload.
    private final byte[]
    This is the terminal token used to delimiter the upload.
  • Constructor Summary

    Constructors
    Constructor
    Description
    PartEntryFactory(Allocator allocator, PartSeries series, byte[] terminal, long length)
    Constructor for the PartEntryFactory object.
  • Method Summary

    Modifier and Type
    Method
    Description
    This creates a new part entry consumer that can be used to read the next part from the list.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • series

      private final PartSeries series
      This is used to accumulate all the parts of the upload.
    • allocator

      private final Allocator allocator
      This is used to allocate the buffers used by the entry.
    • terminal

      private final byte[] terminal
      This is the terminal token used to delimiter the upload.
    • length

      private final long length
      This is the length of the parent part series body.
  • Constructor Details

    • PartEntryFactory

      public PartEntryFactory(Allocator allocator, PartSeries series, byte[] terminal, long length)
      Constructor for the PartEntryFactory object. This is used to create a factory for entry consumers that can be used to read an entry from a part list.
      Parameters:
      allocator - this is the allocator used for buffers
      series - this is the list of parts that are extracted
      terminal - this is the terminal buffer to be used
      length - this is the length of the parent part series
  • Method Details

    • getInstance

      public PartEntryConsumer getInstance()
      This creates a new part entry consumer that can be used to read the next part from the list. The consumer instantiated by this factory acquires the allocator, list and boundary from the enclosing part list consumer instance.
      Returns:
      a part entry consumer for this part list consumer