Interface Multipart

All Known Subinterfaces:
Multipart, Multipart.ByteRanges, Multipart.ByteRanges.Strict, Multipart.FormData, Multipart.FormData.Strict, Multipart.General, Multipart.General.Strict, Multipart.Strict, Multipart.Strict
All Known Implementing Classes:
Multipart.ByteRanges, Multipart.ByteRanges$.Strict, Multipart.FormData, Multipart.FormData$.Strict, Multipart.General, Multipart.General$.Strict

public interface Multipart
The model of multipart content for media-types `multipart/\*` (general multipart content), `multipart/form-data` and `multipart/byteranges`.

The basic modelling classes for these media-types ([[org.apache.pekko.http.scaladsl.Multipart.General]], [[Multipart.FormData]] and [[org.apache.pekko.http.scaladsl.Multipart.ByteRanges]], respectively) are stream-based but each have a strict counterpart (namely [[org.apache.pekko.http.scaladsl.Multipart.General.Strict]], [[org.apache.pekko.http.scaladsl.Multipart.FormData.Strict]] and [[org.apache.pekko.http.scaladsl.Multipart.ByteRanges.Strict]]).

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
     
    static interface 
    Model for `multipart/byteranges` content as defined by https://tools.ietf.org/html/rfc7233#section-5.4.1 and https://tools.ietf.org/html/rfc7233#appendix-A
    static interface 
    Model for `multipart/form-data` content as defined in http://tools.ietf.org/html/rfc2388.
    static interface 
    Basic model for multipart content as defined by http://tools.ietf.org/html/rfc2046.
    static interface 
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    org.apache.pekko.stream.javadsl.Source<? extends Multipart.BodyPart,Object>
     
    Creates an entity from this multipart object using a random boundary.
    toEntity(String boundary)
    Creates an entity from this multipart object using the specified boundary.
    toStrict(long timeoutMillis, org.apache.pekko.stream.Materializer materializer)
    Converts this content into its strict counterpart.
  • Method Details

    • getMediaType

      MediaType.Multipart getMediaType()
    • getParts

      org.apache.pekko.stream.javadsl.Source<? extends Multipart.BodyPart,Object> getParts()
    • toStrict

      CompletionStage<? extends Multipart.Strict> toStrict(long timeoutMillis, org.apache.pekko.stream.Materializer materializer)
      Converts this content into its strict counterpart. The given `timeout` denotes the max time that an individual part must be read in. The CompletionStage is failed with an TimeoutException if one part isn't read completely after the given timeout.
    • toEntity

      RequestEntity toEntity(String boundary)
      Creates an entity from this multipart object using the specified boundary.
    • toEntity

      RequestEntity toEntity()
      Creates an entity from this multipart object using a random boundary.