OfFile

org.http4s.multipart.PartValue.OfFile
final case class OfFile(filename: String, path: Path) extends PartValue

Attributes

Source
PartValue.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait PartValue
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def bytes[F[_] : Files]: EntityBody[F]

Returns a byte-stream representation of the part's body.

Returns a byte-stream representation of the part's body.

For OfString parts, the underlying string is piped through a UTF-8 encoder. For OfFile parts, the underlying file's content will be read from disk.

Attributes

Returns

The part's body as a stream of bytes

Source
PartValue.scala
def fold[A](onString: String => A, onFile: (String, Path) => A): A

Fold over the different PartValue subtypes to compute a value

Fold over the different PartValue subtypes to compute a value

Value parameters

onFile

Called with the underlying filename and file path if this part is an OfFile

onString

Called with the underlying String if this part is an OfString

Attributes

Returns

The value returned by either onString or onFile

Source
PartValue.scala

Inherited methods

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product
def toPart[F[_] : Files](name: String, headers: ToRaw*): Part[F]

Builds a new Part from this PartValue.

Builds a new Part from this PartValue.

Value parameters

headers

Any extra headers to add to the part. Content-Disposition is added automatically based on the name, and in the case of OfFile parts, the filename

name

The name of the part

Attributes

Returns

a new Part based on the given name, applicable filename, and body of this PartValue.

Inherited from:
PartValue
Source
PartValue.scala