From 6eab5ada1eb2e8b50ac858d8ab0973a4839a7d20 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Tue, 7 May 2019 17:52:40 +0100 Subject: [PATCH] [s3metadata] extract to file --- src/main/scala/net/kemitix/s3thorp/S3MetaData.scala | 8 ++++++++ .../scala/net/kemitix/s3thorp/S3MetaDataEnricher.scala | 1 - src/main/scala/net/kemitix/s3thorp/Sync.scala | 6 ------ 3 files changed, 8 insertions(+), 7 deletions(-) create mode 100644 src/main/scala/net/kemitix/s3thorp/S3MetaData.scala diff --git a/src/main/scala/net/kemitix/s3thorp/S3MetaData.scala b/src/main/scala/net/kemitix/s3thorp/S3MetaData.scala new file mode 100644 index 0000000..2c7e0c6 --- /dev/null +++ b/src/main/scala/net/kemitix/s3thorp/S3MetaData.scala @@ -0,0 +1,8 @@ +package net.kemitix.s3thorp + +import net.kemitix.s3thorp.Sync.{Hash, LastModified, LocalPath, RemotePath} + +case class S3MetaData(localPath: LocalPath, + remotePath: RemotePath, + remoteHash: Hash, + remoteLastModified: LastModified) \ No newline at end of file diff --git a/src/main/scala/net/kemitix/s3thorp/S3MetaDataEnricher.scala b/src/main/scala/net/kemitix/s3thorp/S3MetaDataEnricher.scala index a0979da..69ac9b0 100644 --- a/src/main/scala/net/kemitix/s3thorp/S3MetaDataEnricher.scala +++ b/src/main/scala/net/kemitix/s3thorp/S3MetaDataEnricher.scala @@ -4,7 +4,6 @@ import java.nio.file.Path import java.time.Instant import fs2.Stream import cats.effect.IO -import net.kemitix.s3thorp.Sync.S3MetaData import Main.putStrLn trait S3MetaDataEnricher { diff --git a/src/main/scala/net/kemitix/s3thorp/Sync.scala b/src/main/scala/net/kemitix/s3thorp/Sync.scala index 48ae727..1b6ffc3 100644 --- a/src/main/scala/net/kemitix/s3thorp/Sync.scala +++ b/src/main/scala/net/kemitix/s3thorp/Sync.scala @@ -7,7 +7,6 @@ import cats.effect._ import fs2.Stream import net.kemitix.s3thorp.Main.putStrLn -import scala.collection.JavaConverters._ import scala.concurrent.Promise object Sync extends LocalFileStream with S3MetaDataEnricher { @@ -26,11 +25,6 @@ object Sync extends LocalFileStream with S3MetaDataEnricher { type Hash = String // an MD5 hash type LastModified = Instant // or scala equivalent - case class S3MetaData(localPath: LocalPath, - remotePath: RemotePath, - remoteHash: Hash, - remoteLastModified: LastModified) - private def uploadRequiredFilter: S3MetaData => Stream[IO, Path] = s3Metadata => Stream.eval(for { _ <- putStrLn(s"upload required: ${s3Metadata.localPath}") //md5File(localFile)