From 837ab362c3eaa97e86eeff94ccfa4852b3abbc55 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Wed, 8 May 2019 10:02:12 +0100 Subject: [PATCH] [Reactives3client] use S3CatsIOClient --- .../net/kemitix/s3thorp/ReactiveS3Client.scala | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/scala/net/kemitix/s3thorp/ReactiveS3Client.scala b/src/main/scala/net/kemitix/s3thorp/ReactiveS3Client.scala index 4d45820..3e282e9 100644 --- a/src/main/scala/net/kemitix/s3thorp/ReactiveS3Client.scala +++ b/src/main/scala/net/kemitix/s3thorp/ReactiveS3Client.scala @@ -1,20 +1,20 @@ package net.kemitix.s3thorp -import cats.effect.IO import com.github.j5ik2o.reactive.aws.s3.S3AsyncClient +import com.github.j5ik2o.reactive.aws.s3.cats.S3CatsIOClient import software.amazon.awssdk.services.s3.model.HeadObjectRequest import software.amazon.awssdk.services.s3.{S3AsyncClient => JavaS3AsyncClient} class ReactiveS3Client extends S3Client { - val s3Client = S3AsyncClient(JavaS3AsyncClient.create()) + private val s3Client = S3CatsIOClient(S3AsyncClient(JavaS3AsyncClient.create)) override def objectHead(bucket: String, key: String) = { - IO.fromFuture(IO( - s3Client.headObject(HeadObjectRequest.builder() - .bucket(bucket) - .key(key) - .build()))). + val request = HeadObjectRequest.builder() + .bucket(bucket) + .key(key) + .build() + s3Client.headObject(request). map(r => (r.eTag(), r.lastModified())) } }