PartReceiver

org.http4s.multipart.PartReceiver
See thePartReceiver companion trait
object PartReceiver

Attributes

Companion
trait
Source
PartReceiver.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def bodyText[F[_]](implicit F: Concurrent[F]): PartReceiver[F, String]

Creates a PartReceiver which decodes the part body to a String.

Creates a PartReceiver which decodes the part body to a String.

The decoding will use UTF-8 unless the part provides a Content-Type header indicating otherwise.

Attributes

Source
PartReceiver.scala
def decode[F[_], A](implicit decoder: EntityDecoder[F, A]): PartReceiver[F, A]

Creates a PartReceiver that delegates to an implicitly-resolved EntityDecoder to decode the part body, passing strict = false to the underlying decode method.

Creates a PartReceiver that delegates to an implicitly-resolved EntityDecoder to decode the part body, passing strict = false to the underlying decode method.

This method passes strict = false to the decoder.decode method.

Value parameters

decoder

The delegate EntityDecoder

Attributes

Source
PartReceiver.scala
def decodeStrict[F[_], A](implicit decoder: EntityDecoder[F, A]): PartReceiver[F, A]

Creates a PartReceiver that delegates to an implicitly-resolved EntityDecoder to decode the part body, passing strict = true to the underlying decode method.

Creates a PartReceiver that delegates to an implicitly-resolved EntityDecoder to decode the part body, passing strict = true to the underlying decode method.

Value parameters

decoder

The delegate EntityDecoder

Attributes

Source
PartReceiver.scala
def ignore[F[_]]: PartReceiver[F, Unit]

Creates a PartReceiver that ignores the part body.

Creates a PartReceiver that ignores the part body.

Attributes

Source
PartReceiver.scala
def reject[F[_], A](err: DecodeFailure): PartReceiver[F, A]

Creates a PartReceiver that immediately returns the given DecodeFailure instead of consuming the part body.

Creates a PartReceiver that immediately returns the given DecodeFailure instead of consuming the part body.

Value parameters

err

The error returned by the created PartReceiver

Attributes

Source
PartReceiver.scala
def toMixedBuffer[F[_] : Concurrent](maxSizeBeforeFile: Int, chunkSize: Int): PartReceiver[F, Stream[F, Byte]]

Creates a PartReceiver that loads the part's body into an in-memory buffer, up until a specified maximum size, at which point it will instead write the body to a temp file.

Creates a PartReceiver that loads the part's body into an in-memory buffer, up until a specified maximum size, at which point it will instead write the body to a temp file.

The temp file created by this decoder (if any) will be released with the Resource returned by this receiver's receive method.

Value parameters

chunkSize

The chunk size used when reading data back from a temporary file created by this receiver

maxSizeBeforeFile

Maximum number of bytes to be buffered in memory for each part received by the returned receiver. When the in-memory buffer would exceed this limit, the buffer is dumped to a temp file and all subsequent data pulled from the part body will be appended to that file instead of accumulating the memory buffer.

Attributes

Returns

A PartReceiver which dynamically decides whether to buffer the part's body in memory or in a file

Source
PartReceiver.scala
def toTempFile[F[_]](implicit F: Files[F], c: Concurrent[F]): PartReceiver[F, Path]

Creates a PartReceiver which writes the part body to a temporary file, then returns that file's Path.

Creates a PartReceiver which writes the part body to a temporary file, then returns that file's Path.

Attributes

Source
PartReceiver.scala