Adopt deprecated APIs from fs2; use fs2.Path

This commit is contained in:
eikek
2021-08-07 12:20:38 +02:00
parent f92aeb6a0f
commit 1901fe1a8c
41 changed files with 124 additions and 109 deletions

View File

@ -309,7 +309,7 @@ trait Conversions {
): F[UploadData[F]] = {
def parseMeta(body: Stream[F, Byte]): F[ItemUploadMeta] =
body
.through(fs2.text.utf8Decode)
.through(fs2.text.utf8.decode)
.parseJsonAs[ItemUploadMeta]
.map(
_.fold(

View File

@ -9,7 +9,7 @@ package docspell.restserver.http4s
import cats.data.NonEmptyList
import cats.data.OptionT
import cats.effect.Sync
import fs2.text.utf8Encode
import fs2.text.utf8
import fs2.{Pure, Stream}
import org.http4s._
@ -20,14 +20,14 @@ object Responses {
private[this] val pureForbidden: Response[Pure] =
Response(
Status.Forbidden,
body = Stream("Forbidden").through(utf8Encode),
body = Stream("Forbidden").through(utf8.encode),
headers = Headers(`Content-Type`(MediaType.text.plain, Charset.`UTF-8`) :: Nil)
)
private[this] val pureUnauthorized: Response[Pure] =
Response(
Status.Unauthorized,
body = Stream("Unauthorized").through(utf8Encode),
body = Stream("Unauthorized").through(utf8.encode),
headers = Headers(`Content-Type`(MediaType.text.plain, Charset.`UTF-8`) :: Nil)
)

View File

@ -92,7 +92,7 @@ object TemplateRoutes {
Stream
.bracket(Sync[F].delay(url.openStream))(in => Sync[F].delay(in.close()))
.flatMap(in => fs2.io.readInputStream(in.pure[F], 64 * 1024, false))
.through(text.utf8Decode)
.through(text.utf8.decode)
.compile
.fold("")(_ + _)