From 9196dd623ff2c379529824614605e64d937f758e Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Mon, 17 Jun 2019 15:33:49 +0100 Subject: [PATCH] Rename project to Thorp (#75) * [sbt] change application name * [cli] rename package * [cli] Change displayed application name and description * [domain] rename package * [core] fix bad package directory structure * [core] rename package * [aws-lib] rename package * [aws-api] rename package * [cli] rename programe for usage message * [bin] rename and update script * [gitignore] update * [readme] update --- .gitignore | 2 +- README.org | 14 +++++++------- .../{s3thorp => thorp}/aws/api/S3Action.scala | 4 ++-- .../{s3thorp => thorp}/aws/api/S3Client.scala | 6 +++--- .../aws/api/UploadEvent.scala | 2 +- .../aws/api/UploadProgressListener.scala | 6 +++--- .../aws/api/UploadProgressLogging.scala | 10 +++++----- .../aws/lib/S3ClientBuilder.scala | 4 ++-- .../aws/lib/S3ClientCopier.scala | 8 ++++---- .../aws/lib/S3ClientDeleter.scala | 8 ++++---- .../aws/lib/S3ClientLogging.scala | 5 ++--- .../aws/lib/S3ClientObjectLister.scala | 13 +++++++------ .../aws/lib/S3ObjectsByHash.scala | 4 ++-- .../aws/lib/S3ObjectsByKey.scala | 4 ++-- .../aws/lib/ThorpS3Client.scala | 8 ++++---- .../{s3thorp => thorp}/aws/lib/Uploader.scala | 12 ++++++------ .../aws/lib/UploaderLogging.scala | 8 ++++---- .../{s3thorp => thorp}/aws/lib/big-file | Bin .../{s3thorp => thorp}/aws/lib/small-file | Bin .../aws/lib/test-file-for-hash.txt | 0 .../aws/lib/upload/root-file | 0 .../aws/lib/upload/subdir/leaf-file | 0 .../kemitix/thorp/aws/lib}/DummyLogger.scala | 4 ++-- .../kemitix/thorp/aws/lib}/MD5HashData.scala | 4 ++-- .../aws/lib/S3ClientSuite.scala | 12 ++++++------ .../aws/lib/S3ObjectsByHashSuite.scala | 4 ++-- .../aws/lib/ThorpS3ClientSuite.scala | 6 +++--- .../aws/lib/UploaderSuite.scala | 12 ++++++------ bin/{s3thorp => thorp} | 2 +- build.sbt | 4 ++-- .../kemitix/{s3thorp => thorp}/cli/Main.scala | 4 ++-- .../{s3thorp => thorp}/cli/ParseArgs.scala | 10 +++++----- .../{s3thorp => thorp}/cli/PrintLogger.scala | 4 ++-- .../{s3thorp => thorp}/cli/Program.scala | 10 +++++----- .../cli/ParseArgsTest.scala | 6 +++--- .../kemitix/thorp/core}/Action.scala | 4 ++-- .../kemitix/thorp/core}/ActionGenerator.scala | 6 +++--- .../kemitix/thorp/core}/ActionSubmitter.scala | 10 +++++----- .../kemitix/thorp/core}/Counters.scala | 2 +- .../kemitix/thorp/core}/KeyGenerator.scala | 4 ++-- .../kemitix/thorp/core}/LocalFileStream.scala | 9 +++++---- .../thorp/core}/MD5HashGenerator.scala | 4 ++-- .../kemitix/thorp/core}/Resource.scala | 2 +- .../thorp/core}/S3MetaDataEnricher.scala | 4 ++-- .../kemitix/thorp/core}/Sync.scala | 18 +++++++++--------- .../kemitix/thorp/core}/SyncLogging.scala | 8 ++++---- .../kemitix/{s3thorp => thorp}/core/big-file | Bin .../{s3thorp => thorp}/core/small-file | Bin .../{s3thorp => thorp}/core/upload/root-file | 0 .../core/upload/subdir/leaf-file | 0 .../core/ActionGeneratorSuite.scala | 6 +++--- .../net/kemitix/thorp/core}/DummyLogger.scala | 4 ++-- .../core/KeyGeneratorSuite.scala | 4 ++-- .../core/LocalFileStreamSuite.scala | 4 ++-- .../net/kemitix/thorp/core}/MD5HashData.scala | 4 ++-- .../core/MD5HashGeneratorTest.scala | 6 +++--- .../core/S3ActionSuite.scala | 6 +++--- .../core/S3MetaDataEnricherSuite.scala | 6 +++--- .../{s3thorp => thorp}/core/SyncSuite.scala | 12 ++++++------ .../net/kemitix/s3thorp/domain/MD5Hash.scala | 9 --------- .../{s3thorp => thorp}/domain/Bucket.scala | 2 +- .../{s3thorp => thorp}/domain/Config.scala | 2 +- .../{s3thorp => thorp}/domain/Filter.scala | 2 +- .../domain/HashModified.scala | 2 +- .../domain/KeyModified.scala | 2 +- .../domain/LastModified.scala | 2 +- .../{s3thorp => thorp}/domain/LocalFile.scala | 2 +- .../{s3thorp => thorp}/domain/Logger.scala | 2 +- .../net/kemitix/thorp/domain/MD5Hash.scala | 9 +++++++++ .../domain/QuoteStripper.scala | 2 +- .../{s3thorp => thorp}/domain/RemoteKey.scala | 2 +- .../domain/RemoteMetaData.scala | 2 +- .../domain/S3MetaData.scala | 2 +- .../domain/S3ObjectsData.scala | 2 +- .../domain/SizeTranslation.scala | 2 +- .../{s3thorp => thorp}/domain/Terminal.scala | 2 +- .../domain/FiltersSuite.scala | 6 +++--- .../domain/SizeTranslationTest.scala | 2 +- 78 files changed, 190 insertions(+), 189 deletions(-) rename aws-api/src/main/scala/net/kemitix/{s3thorp => thorp}/aws/api/S3Action.scala (90%) rename aws-api/src/main/scala/net/kemitix/{s3thorp => thorp}/aws/api/S3Client.scala (78%) rename aws-api/src/main/scala/net/kemitix/{s3thorp => thorp}/aws/api/UploadEvent.scala (91%) rename aws-api/src/main/scala/net/kemitix/{s3thorp => thorp}/aws/api/UploadProgressListener.scala (64%) rename aws-api/src/main/scala/net/kemitix/{s3thorp => thorp}/aws/api/UploadProgressLogging.scala (73%) rename aws-lib/src/main/scala/net/kemitix/{s3thorp => thorp}/aws/lib/S3ClientBuilder.scala (87%) rename aws-lib/src/main/scala/net/kemitix/{s3thorp => thorp}/aws/lib/S3ClientCopier.scala (79%) rename aws-lib/src/main/scala/net/kemitix/{s3thorp => thorp}/aws/lib/S3ClientDeleter.scala (73%) rename aws-lib/src/main/scala/net/kemitix/{s3thorp => thorp}/aws/lib/S3ClientLogging.scala (90%) rename aws-lib/src/main/scala/net/kemitix/{s3thorp => thorp}/aws/lib/S3ClientObjectLister.scala (80%) rename aws-lib/src/main/scala/net/kemitix/{s3thorp => thorp}/aws/lib/S3ObjectsByHash.scala (82%) rename aws-lib/src/main/scala/net/kemitix/{s3thorp => thorp}/aws/lib/S3ObjectsByKey.scala (75%) rename aws-lib/src/main/scala/net/kemitix/{s3thorp => thorp}/aws/lib/ThorpS3Client.scala (87%) rename aws-lib/src/main/scala/net/kemitix/{s3thorp => thorp}/aws/lib/Uploader.scala (85%) rename aws-lib/src/main/scala/net/kemitix/{s3thorp => thorp}/aws/lib/UploaderLogging.scala (75%) rename aws-lib/src/test/resources/net/kemitix/{s3thorp => thorp}/aws/lib/big-file (100%) rename aws-lib/src/test/resources/net/kemitix/{s3thorp => thorp}/aws/lib/small-file (100%) rename aws-lib/src/test/resources/net/kemitix/{s3thorp => thorp}/aws/lib/test-file-for-hash.txt (100%) rename aws-lib/src/test/resources/net/kemitix/{s3thorp => thorp}/aws/lib/upload/root-file (100%) rename aws-lib/src/test/resources/net/kemitix/{s3thorp => thorp}/aws/lib/upload/subdir/leaf-file (100%) rename {core/src/test/scala/net/kemitix/s3thorp/core => aws-lib/src/test/scala/net/kemitix/thorp/aws/lib}/DummyLogger.scala (81%) rename {core/src/test/scala/net/kemitix/s3thorp/core => aws-lib/src/test/scala/net/kemitix/thorp/aws/lib}/MD5HashData.scala (66%) rename aws-lib/src/test/scala/net/kemitix/{s3thorp => thorp}/aws/lib/S3ClientSuite.scala (92%) rename aws-lib/src/test/scala/net/kemitix/{s3thorp => thorp}/aws/lib/S3ObjectsByHashSuite.scala (91%) rename aws-lib/src/test/scala/net/kemitix/{s3thorp => thorp}/aws/lib/ThorpS3ClientSuite.scala (95%) rename aws-lib/src/test/scala/net/kemitix/{s3thorp => thorp}/aws/lib/UploaderSuite.scala (90%) rename bin/{s3thorp => thorp} (60%) rename cli/src/main/scala/net/kemitix/{s3thorp => thorp}/cli/Main.scala (89%) rename cli/src/main/scala/net/kemitix/{s3thorp => thorp}/cli/ParseArgs.scala (87%) rename cli/src/main/scala/net/kemitix/{s3thorp => thorp}/cli/PrintLogger.scala (87%) rename cli/src/main/scala/net/kemitix/{s3thorp => thorp}/cli/Program.scala (58%) rename cli/src/test/scala/net/kemitix/{s3thorp => thorp}/cli/ParseArgsTest.scala (94%) rename core/src/main/scala/{net.kemitix.s3thorp.core => net/kemitix/thorp/core}/Action.scala (84%) rename core/src/main/scala/{net.kemitix.s3thorp.core => net/kemitix/thorp/core}/ActionGenerator.scala (93%) rename core/src/main/scala/{net.kemitix.s3thorp.core => net/kemitix/thorp/core}/ActionSubmitter.scala (79%) rename core/src/main/scala/{net.kemitix.s3thorp.core => net/kemitix/thorp/core}/Counters.scala (84%) rename core/src/main/scala/{net.kemitix.s3thorp.core => net/kemitix/thorp/core}/KeyGenerator.scala (81%) rename core/src/main/scala/{net.kemitix.s3thorp.core => net/kemitix/thorp/core}/LocalFileStream.scala (84%) rename core/src/main/scala/{net.kemitix.s3thorp.core => net/kemitix/thorp/core}/MD5HashGenerator.scala (95%) rename core/src/main/scala/{net.kemitix.s3thorp.core => net/kemitix/thorp/core}/Resource.scala (89%) rename core/src/main/scala/{net.kemitix.s3thorp.core => net/kemitix/thorp/core}/S3MetaDataEnricher.scala (92%) rename core/src/main/scala/{net.kemitix.s3thorp.core => net/kemitix/thorp/core}/Sync.scala (76%) rename core/src/main/scala/{net.kemitix.s3thorp.core => net/kemitix/thorp/core}/SyncLogging.scala (86%) rename core/src/test/resources/net/kemitix/{s3thorp => thorp}/core/big-file (100%) rename core/src/test/resources/net/kemitix/{s3thorp => thorp}/core/small-file (100%) rename core/src/test/resources/net/kemitix/{s3thorp => thorp}/core/upload/root-file (100%) rename core/src/test/resources/net/kemitix/{s3thorp => thorp}/core/upload/subdir/leaf-file (100%) rename core/src/test/scala/net/kemitix/{s3thorp => thorp}/core/ActionGeneratorSuite.scala (97%) rename {aws-lib/src/test/scala/net/kemitix/s3thorp/aws/lib => core/src/test/scala/net/kemitix/thorp/core}/DummyLogger.scala (81%) rename core/src/test/scala/net/kemitix/{s3thorp => thorp}/core/KeyGeneratorSuite.scala (91%) rename core/src/test/scala/net/kemitix/{s3thorp => thorp}/core/LocalFileStreamSuite.scala (86%) rename {aws-lib/src/test/scala/net/kemitix/s3thorp/aws/lib => core/src/test/scala/net/kemitix/thorp/core}/MD5HashData.scala (65%) rename core/src/test/scala/net/kemitix/{s3thorp => thorp}/core/MD5HashGeneratorTest.scala (84%) rename core/src/test/scala/net/kemitix/{s3thorp => thorp}/core/S3ActionSuite.scala (75%) rename core/src/test/scala/net/kemitix/{s3thorp => thorp}/core/S3MetaDataEnricherSuite.scala (98%) rename core/src/test/scala/net/kemitix/{s3thorp => thorp}/core/SyncSuite.scala (95%) delete mode 100644 domain/src/main/scala/net/kemitix/s3thorp/domain/MD5Hash.scala rename domain/src/main/scala/net/kemitix/{s3thorp => thorp}/domain/Bucket.scala (52%) rename domain/src/main/scala/net/kemitix/{s3thorp => thorp}/domain/Config.scala (94%) rename domain/src/main/scala/net/kemitix/{s3thorp => thorp}/domain/Filter.scala (97%) rename domain/src/main/scala/net/kemitix/{s3thorp => thorp}/domain/HashModified.scala (74%) rename domain/src/main/scala/net/kemitix/{s3thorp => thorp}/domain/KeyModified.scala (73%) rename domain/src/main/scala/net/kemitix/{s3thorp => thorp}/domain/LastModified.scala (67%) rename domain/src/main/scala/net/kemitix/{s3thorp => thorp}/domain/LocalFile.scala (95%) rename domain/src/main/scala/net/kemitix/{s3thorp => thorp}/domain/Logger.scala (83%) create mode 100644 domain/src/main/scala/net/kemitix/thorp/domain/MD5Hash.scala rename domain/src/main/scala/net/kemitix/{s3thorp => thorp}/domain/QuoteStripper.scala (67%) rename domain/src/main/scala/net/kemitix/{s3thorp => thorp}/domain/RemoteKey.scala (92%) rename domain/src/main/scala/net/kemitix/{s3thorp => thorp}/domain/RemoteMetaData.scala (82%) rename domain/src/main/scala/net/kemitix/{s3thorp => thorp}/domain/S3MetaData.scala (87%) rename domain/src/main/scala/net/kemitix/{s3thorp => thorp}/domain/S3ObjectsData.scala (84%) rename domain/src/main/scala/net/kemitix/{s3thorp => thorp}/domain/SizeTranslation.scala (92%) rename domain/src/main/scala/net/kemitix/{s3thorp => thorp}/domain/Terminal.scala (94%) rename domain/src/test/scala/net/kemitix/{s3thorp => thorp}/domain/FiltersSuite.scala (97%) rename domain/src/test/scala/net/kemitix/{s3thorp => thorp}/domain/SizeTranslationTest.scala (96%) diff --git a/.gitignore b/.gitignore index ec7b839..054358a 100644 --- a/.gitignore +++ b/.gitignore @@ -28,5 +28,5 @@ project/plugins/project/ ### Metals ### .bloop/ .metals/ -/s3thorp +/thorp *.zip diff --git a/README.org b/README.org index cc31d7a..a50ea06 100644 --- a/README.org +++ b/README.org @@ -1,8 +1,8 @@ -* s3thorp +* thorp Synchronisation of files with S3 using the hash of the file contents. -[[https://www.codacy.com/app/kemitix/s3thorp][file:https://img.shields.io/codacy/grade/14ea6ad0825249c994a27a82d3485180.svg?style=for-the-badge]] +[[https://www.codacy.com/app/kemitix/thorp][file:https://img.shields.io/codacy/grade/14ea6ad0825249c994a27a82d3485180.svg?style=for-the-badge]] Originally based on Alex Kudlick's [[https://github.com/akud/aws-s3-sync-by-hash][aws-s3-sync-by-hash]]. @@ -13,8 +13,8 @@ hash of the file contents. * Usage #+begin_example - s3thorp - Usage: s3thorp [options] + thorp + Usage: thorp [options] -s, --source Source directory to sync to S3 -b, --bucket S3 bucket name @@ -46,8 +46,8 @@ When considering a local file, the following table governs what should happen: To build as an executable jar, perform `sbt assembly` This will create the file -`cli/target/scala-2.12/s3thorp-assembly-$VERSION.jar` (where $VERSION +`cli/target/scala-2.12/thorp-assembly-$VERSION.jar` (where $VERSION is substituted) -Copy and rename this file as `s3thorp.jar` into the same directory as -the `bin/s3throp` shell script. +Copy and rename this file as `thorp.jar` into the same directory as +the `bin/throp` shell script. diff --git a/aws-api/src/main/scala/net/kemitix/s3thorp/aws/api/S3Action.scala b/aws-api/src/main/scala/net/kemitix/thorp/aws/api/S3Action.scala similarity index 90% rename from aws-api/src/main/scala/net/kemitix/s3thorp/aws/api/S3Action.scala rename to aws-api/src/main/scala/net/kemitix/thorp/aws/api/S3Action.scala index 6305d85..d502fb6 100644 --- a/aws-api/src/main/scala/net/kemitix/s3thorp/aws/api/S3Action.scala +++ b/aws-api/src/main/scala/net/kemitix/thorp/aws/api/S3Action.scala @@ -1,6 +1,6 @@ -package net.kemitix.s3thorp.aws.api +package net.kemitix.thorp.aws.api -import net.kemitix.s3thorp.domain.{MD5Hash, RemoteKey} +import net.kemitix.thorp.domain.{MD5Hash, RemoteKey} sealed trait S3Action { diff --git a/aws-api/src/main/scala/net/kemitix/s3thorp/aws/api/S3Client.scala b/aws-api/src/main/scala/net/kemitix/thorp/aws/api/S3Client.scala similarity index 78% rename from aws-api/src/main/scala/net/kemitix/s3thorp/aws/api/S3Client.scala rename to aws-api/src/main/scala/net/kemitix/thorp/aws/api/S3Client.scala index 7835490..c38e43c 100644 --- a/aws-api/src/main/scala/net/kemitix/s3thorp/aws/api/S3Client.scala +++ b/aws-api/src/main/scala/net/kemitix/thorp/aws/api/S3Client.scala @@ -1,7 +1,7 @@ -package net.kemitix.s3thorp.aws.api +package net.kemitix.thorp.aws.api -import net.kemitix.s3thorp.aws.api.S3Action.{CopyS3Action, DeleteS3Action} -import net.kemitix.s3thorp.domain.{Bucket, LocalFile, Logger, MD5Hash, RemoteKey, S3ObjectsData} +import net.kemitix.thorp.aws.api.S3Action.{CopyS3Action, DeleteS3Action} +import net.kemitix.thorp.domain._ trait S3Client[M[_]] { diff --git a/aws-api/src/main/scala/net/kemitix/s3thorp/aws/api/UploadEvent.scala b/aws-api/src/main/scala/net/kemitix/thorp/aws/api/UploadEvent.scala similarity index 91% rename from aws-api/src/main/scala/net/kemitix/s3thorp/aws/api/UploadEvent.scala rename to aws-api/src/main/scala/net/kemitix/thorp/aws/api/UploadEvent.scala index 5e0eba0..7914308 100644 --- a/aws-api/src/main/scala/net/kemitix/s3thorp/aws/api/UploadEvent.scala +++ b/aws-api/src/main/scala/net/kemitix/thorp/aws/api/UploadEvent.scala @@ -1,4 +1,4 @@ -package net.kemitix.s3thorp.aws.api +package net.kemitix.thorp.aws.api sealed trait UploadEvent { def name: String diff --git a/aws-api/src/main/scala/net/kemitix/s3thorp/aws/api/UploadProgressListener.scala b/aws-api/src/main/scala/net/kemitix/thorp/aws/api/UploadProgressListener.scala similarity index 64% rename from aws-api/src/main/scala/net/kemitix/s3thorp/aws/api/UploadProgressListener.scala rename to aws-api/src/main/scala/net/kemitix/thorp/aws/api/UploadProgressListener.scala index 7c89906..0d8fcae 100644 --- a/aws-api/src/main/scala/net/kemitix/s3thorp/aws/api/UploadProgressListener.scala +++ b/aws-api/src/main/scala/net/kemitix/thorp/aws/api/UploadProgressListener.scala @@ -1,7 +1,7 @@ -package net.kemitix.s3thorp.aws.api +package net.kemitix.thorp.aws.api -import net.kemitix.s3thorp.aws.api.UploadEvent.{ByteTransferEvent, RequestEvent, TransferEvent} -import net.kemitix.s3thorp.domain.LocalFile +import net.kemitix.thorp.aws.api.UploadEvent.RequestEvent +import net.kemitix.thorp.domain.LocalFile class UploadProgressListener(localFile: LocalFile) extends UploadProgressLogging { diff --git a/aws-api/src/main/scala/net/kemitix/s3thorp/aws/api/UploadProgressLogging.scala b/aws-api/src/main/scala/net/kemitix/thorp/aws/api/UploadProgressLogging.scala similarity index 73% rename from aws-api/src/main/scala/net/kemitix/s3thorp/aws/api/UploadProgressLogging.scala rename to aws-api/src/main/scala/net/kemitix/thorp/aws/api/UploadProgressLogging.scala index 974b7f3..ad5167b 100644 --- a/aws-api/src/main/scala/net/kemitix/s3thorp/aws/api/UploadProgressLogging.scala +++ b/aws-api/src/main/scala/net/kemitix/thorp/aws/api/UploadProgressLogging.scala @@ -1,9 +1,9 @@ -package net.kemitix.s3thorp.aws.api +package net.kemitix.thorp.aws.api -import net.kemitix.s3thorp.aws.api.UploadEvent.{ByteTransferEvent, RequestEvent, TransferEvent} -import net.kemitix.s3thorp.domain.Terminal.{clearLine, returnToPreviousLine} -import net.kemitix.s3thorp.domain.{LocalFile, Terminal} -import net.kemitix.s3thorp.domain.SizeTranslation.sizeInEnglish +import net.kemitix.thorp.aws.api.UploadEvent.RequestEvent +import net.kemitix.thorp.domain.SizeTranslation.sizeInEnglish +import net.kemitix.thorp.domain.Terminal.{clearLine, returnToPreviousLine} +import net.kemitix.thorp.domain.{LocalFile, Terminal} import scala.io.AnsiColor._ diff --git a/aws-lib/src/main/scala/net/kemitix/s3thorp/aws/lib/S3ClientBuilder.scala b/aws-lib/src/main/scala/net/kemitix/thorp/aws/lib/S3ClientBuilder.scala similarity index 87% rename from aws-lib/src/main/scala/net/kemitix/s3thorp/aws/lib/S3ClientBuilder.scala rename to aws-lib/src/main/scala/net/kemitix/thorp/aws/lib/S3ClientBuilder.scala index dfcfe74..ca75ef8 100644 --- a/aws-lib/src/main/scala/net/kemitix/s3thorp/aws/lib/S3ClientBuilder.scala +++ b/aws-lib/src/main/scala/net/kemitix/thorp/aws/lib/S3ClientBuilder.scala @@ -1,9 +1,9 @@ -package net.kemitix.s3thorp.aws.lib +package net.kemitix.thorp.aws.lib import cats.Monad import com.amazonaws.services.s3.transfer.{TransferManager, TransferManagerBuilder} import com.amazonaws.services.s3.{AmazonS3, AmazonS3ClientBuilder} -import net.kemitix.s3thorp.aws.api.S3Client +import net.kemitix.thorp.aws.api.S3Client object S3ClientBuilder { diff --git a/aws-lib/src/main/scala/net/kemitix/s3thorp/aws/lib/S3ClientCopier.scala b/aws-lib/src/main/scala/net/kemitix/thorp/aws/lib/S3ClientCopier.scala similarity index 79% rename from aws-lib/src/main/scala/net/kemitix/s3thorp/aws/lib/S3ClientCopier.scala rename to aws-lib/src/main/scala/net/kemitix/thorp/aws/lib/S3ClientCopier.scala index ae7e638..b3662be 100644 --- a/aws-lib/src/main/scala/net/kemitix/s3thorp/aws/lib/S3ClientCopier.scala +++ b/aws-lib/src/main/scala/net/kemitix/thorp/aws/lib/S3ClientCopier.scala @@ -1,12 +1,12 @@ -package net.kemitix.s3thorp.aws.lib +package net.kemitix.thorp.aws.lib import cats.Monad import cats.implicits._ import com.amazonaws.services.s3.AmazonS3 import com.amazonaws.services.s3.model.CopyObjectRequest -import net.kemitix.s3thorp.aws.api.S3Action.CopyS3Action -import net.kemitix.s3thorp.aws.lib.S3ClientLogging.{logCopyFinish, logCopyStart} -import net.kemitix.s3thorp.domain.{Bucket, Logger, MD5Hash, RemoteKey} +import net.kemitix.thorp.aws.api.S3Action.CopyS3Action +import net.kemitix.thorp.aws.lib.S3ClientLogging.{logCopyFinish, logCopyStart} +import net.kemitix.thorp.domain.{Bucket, Logger, MD5Hash, RemoteKey} class S3ClientCopier[M[_]: Monad](amazonS3: AmazonS3) { diff --git a/aws-lib/src/main/scala/net/kemitix/s3thorp/aws/lib/S3ClientDeleter.scala b/aws-lib/src/main/scala/net/kemitix/thorp/aws/lib/S3ClientDeleter.scala similarity index 73% rename from aws-lib/src/main/scala/net/kemitix/s3thorp/aws/lib/S3ClientDeleter.scala rename to aws-lib/src/main/scala/net/kemitix/thorp/aws/lib/S3ClientDeleter.scala index 0cae593..59c7877 100644 --- a/aws-lib/src/main/scala/net/kemitix/s3thorp/aws/lib/S3ClientDeleter.scala +++ b/aws-lib/src/main/scala/net/kemitix/thorp/aws/lib/S3ClientDeleter.scala @@ -1,12 +1,12 @@ -package net.kemitix.s3thorp.aws.lib +package net.kemitix.thorp.aws.lib import cats.Monad import cats.implicits._ import com.amazonaws.services.s3.AmazonS3 import com.amazonaws.services.s3.model.DeleteObjectRequest -import net.kemitix.s3thorp.aws.api.S3Action.DeleteS3Action -import net.kemitix.s3thorp.aws.lib.S3ClientLogging.{logDeleteFinish, logDeleteStart} -import net.kemitix.s3thorp.domain.{Bucket, Logger, RemoteKey} +import net.kemitix.thorp.aws.api.S3Action.DeleteS3Action +import net.kemitix.thorp.aws.lib.S3ClientLogging.{logDeleteFinish, logDeleteStart} +import net.kemitix.thorp.domain.{Bucket, Logger, RemoteKey} class S3ClientDeleter[M[_]: Monad](amazonS3: AmazonS3) { diff --git a/aws-lib/src/main/scala/net/kemitix/s3thorp/aws/lib/S3ClientLogging.scala b/aws-lib/src/main/scala/net/kemitix/thorp/aws/lib/S3ClientLogging.scala similarity index 90% rename from aws-lib/src/main/scala/net/kemitix/s3thorp/aws/lib/S3ClientLogging.scala rename to aws-lib/src/main/scala/net/kemitix/thorp/aws/lib/S3ClientLogging.scala index c56cdba..a7a9c63 100644 --- a/aws-lib/src/main/scala/net/kemitix/s3thorp/aws/lib/S3ClientLogging.scala +++ b/aws-lib/src/main/scala/net/kemitix/thorp/aws/lib/S3ClientLogging.scala @@ -1,8 +1,7 @@ -package net.kemitix.s3thorp.aws.lib +package net.kemitix.thorp.aws.lib import cats.Monad -import com.amazonaws.services.s3.model.PutObjectResult -import net.kemitix.s3thorp.domain.{Bucket, LocalFile, Logger, RemoteKey} +import net.kemitix.thorp.domain.{Bucket, Logger, RemoteKey} object S3ClientLogging { diff --git a/aws-lib/src/main/scala/net/kemitix/s3thorp/aws/lib/S3ClientObjectLister.scala b/aws-lib/src/main/scala/net/kemitix/thorp/aws/lib/S3ClientObjectLister.scala similarity index 80% rename from aws-lib/src/main/scala/net/kemitix/s3thorp/aws/lib/S3ClientObjectLister.scala rename to aws-lib/src/main/scala/net/kemitix/thorp/aws/lib/S3ClientObjectLister.scala index 272d90d..c58a0cb 100644 --- a/aws-lib/src/main/scala/net/kemitix/s3thorp/aws/lib/S3ClientObjectLister.scala +++ b/aws-lib/src/main/scala/net/kemitix/thorp/aws/lib/S3ClientObjectLister.scala @@ -1,13 +1,14 @@ -package net.kemitix.s3thorp.aws.lib +package net.kemitix.thorp.aws.lib import cats.Monad import cats.implicits._ import com.amazonaws.services.s3.AmazonS3 import com.amazonaws.services.s3.model.{ListObjectsV2Request, S3ObjectSummary} -import net.kemitix.s3thorp.aws.lib.S3ClientLogging.{logListObjectsFinish, logListObjectsStart} -import net.kemitix.s3thorp.aws.lib.S3ObjectsByHash.byHash -import net.kemitix.s3thorp.aws.lib.S3ObjectsByKey.byKey -import net.kemitix.s3thorp.domain._ +import net.kemitix.thorp.aws.lib.S3ClientLogging.{logListObjectsFinish, logListObjectsStart} +import net.kemitix.thorp.aws.lib.S3ObjectsByHash.byHash +import net.kemitix.thorp.aws.lib.S3ObjectsByKey.byKey +import net.kemitix.thorp.domain +import net.kemitix.thorp.domain.{Bucket, Logger, RemoteKey, S3ObjectsData} import scala.collection.JavaConverters._ @@ -54,7 +55,7 @@ class S3ClientObjectLister[M[_]: Monad](amazonS3: AmazonS3) { r = new ListObjectsV2Request().withBucketName(bucket.name).withPrefix(prefix.key) summaries <- fetch(r) _ <- logListObjectsFinish[M](bucket, prefix) - } yield S3ObjectsData(byHash(summaries), byKey(summaries)) + } yield domain.S3ObjectsData(byHash(summaries), byKey(summaries)) } } diff --git a/aws-lib/src/main/scala/net/kemitix/s3thorp/aws/lib/S3ObjectsByHash.scala b/aws-lib/src/main/scala/net/kemitix/thorp/aws/lib/S3ObjectsByHash.scala similarity index 82% rename from aws-lib/src/main/scala/net/kemitix/s3thorp/aws/lib/S3ObjectsByHash.scala rename to aws-lib/src/main/scala/net/kemitix/thorp/aws/lib/S3ObjectsByHash.scala index 8a75086..86d6ecf 100644 --- a/aws-lib/src/main/scala/net/kemitix/s3thorp/aws/lib/S3ObjectsByHash.scala +++ b/aws-lib/src/main/scala/net/kemitix/thorp/aws/lib/S3ObjectsByHash.scala @@ -1,7 +1,7 @@ -package net.kemitix.s3thorp.aws.lib +package net.kemitix.thorp.aws.lib import com.amazonaws.services.s3.model.S3ObjectSummary -import net.kemitix.s3thorp.domain.{KeyModified, LastModified, MD5Hash, RemoteKey} +import net.kemitix.thorp.domain.{KeyModified, LastModified, MD5Hash, RemoteKey} object S3ObjectsByHash { diff --git a/aws-lib/src/main/scala/net/kemitix/s3thorp/aws/lib/S3ObjectsByKey.scala b/aws-lib/src/main/scala/net/kemitix/thorp/aws/lib/S3ObjectsByKey.scala similarity index 75% rename from aws-lib/src/main/scala/net/kemitix/s3thorp/aws/lib/S3ObjectsByKey.scala rename to aws-lib/src/main/scala/net/kemitix/thorp/aws/lib/S3ObjectsByKey.scala index 0ed6a7c..0459f79 100644 --- a/aws-lib/src/main/scala/net/kemitix/s3thorp/aws/lib/S3ObjectsByKey.scala +++ b/aws-lib/src/main/scala/net/kemitix/thorp/aws/lib/S3ObjectsByKey.scala @@ -1,7 +1,7 @@ -package net.kemitix.s3thorp.aws.lib +package net.kemitix.thorp.aws.lib import com.amazonaws.services.s3.model.S3ObjectSummary -import net.kemitix.s3thorp.domain.{HashModified, LastModified, MD5Hash, RemoteKey} +import net.kemitix.thorp.domain.{HashModified, LastModified, MD5Hash, RemoteKey} object S3ObjectsByKey { diff --git a/aws-lib/src/main/scala/net/kemitix/s3thorp/aws/lib/ThorpS3Client.scala b/aws-lib/src/main/scala/net/kemitix/thorp/aws/lib/ThorpS3Client.scala similarity index 87% rename from aws-lib/src/main/scala/net/kemitix/s3thorp/aws/lib/ThorpS3Client.scala rename to aws-lib/src/main/scala/net/kemitix/thorp/aws/lib/ThorpS3Client.scala index cfa5456..7ceb671 100644 --- a/aws-lib/src/main/scala/net/kemitix/s3thorp/aws/lib/ThorpS3Client.scala +++ b/aws-lib/src/main/scala/net/kemitix/thorp/aws/lib/ThorpS3Client.scala @@ -1,11 +1,11 @@ -package net.kemitix.s3thorp.aws.lib +package net.kemitix.thorp.aws.lib import cats.Monad import com.amazonaws.services.s3.AmazonS3 import com.amazonaws.services.s3.transfer.TransferManager -import net.kemitix.s3thorp.aws.api.S3Action.{CopyS3Action, DeleteS3Action} -import net.kemitix.s3thorp.aws.api.{S3Action, S3Client, UploadProgressListener} -import net.kemitix.s3thorp.domain._ +import net.kemitix.thorp.aws.api.S3Action.{CopyS3Action, DeleteS3Action} +import net.kemitix.thorp.aws.api.{S3Action, S3Client, UploadProgressListener} +import net.kemitix.thorp.domain._ class ThorpS3Client[M[_]: Monad](amazonS3Client: => AmazonS3, amazonS3TransferManager: => TransferManager) diff --git a/aws-lib/src/main/scala/net/kemitix/s3thorp/aws/lib/Uploader.scala b/aws-lib/src/main/scala/net/kemitix/thorp/aws/lib/Uploader.scala similarity index 85% rename from aws-lib/src/main/scala/net/kemitix/s3thorp/aws/lib/Uploader.scala rename to aws-lib/src/main/scala/net/kemitix/thorp/aws/lib/Uploader.scala index 98b928e..704ef8c 100644 --- a/aws-lib/src/main/scala/net/kemitix/s3thorp/aws/lib/Uploader.scala +++ b/aws-lib/src/main/scala/net/kemitix/thorp/aws/lib/Uploader.scala @@ -1,4 +1,4 @@ -package net.kemitix.s3thorp.aws.lib +package net.kemitix.thorp.aws.lib import cats.Monad import cats.implicits._ @@ -6,11 +6,11 @@ import com.amazonaws.event.{ProgressEvent, ProgressEventType, ProgressListener} import com.amazonaws.services.s3.model.PutObjectRequest import com.amazonaws.services.s3.transfer.model.UploadResult import com.amazonaws.services.s3.transfer.{TransferManager => AmazonTransferManager} -import net.kemitix.s3thorp.aws.api.S3Action.{ErroredS3Action, UploadS3Action} -import net.kemitix.s3thorp.aws.api.UploadEvent.{ByteTransferEvent, RequestEvent, TransferEvent} -import net.kemitix.s3thorp.aws.api.{S3Action, UploadProgressListener} -import net.kemitix.s3thorp.aws.lib.UploaderLogging.{logMultiPartUploadFinished, logMultiPartUploadStart} -import net.kemitix.s3thorp.domain.{Bucket, LocalFile, Logger, MD5Hash, RemoteKey} +import net.kemitix.thorp.aws.api.S3Action.{ErroredS3Action, UploadS3Action} +import net.kemitix.thorp.aws.api.UploadEvent.{ByteTransferEvent, RequestEvent, TransferEvent} +import net.kemitix.thorp.aws.api.{S3Action, UploadProgressListener} +import net.kemitix.thorp.aws.lib.UploaderLogging.{logMultiPartUploadFinished, logMultiPartUploadStart} +import net.kemitix.thorp.domain._ import scala.util.Try diff --git a/aws-lib/src/main/scala/net/kemitix/s3thorp/aws/lib/UploaderLogging.scala b/aws-lib/src/main/scala/net/kemitix/thorp/aws/lib/UploaderLogging.scala similarity index 75% rename from aws-lib/src/main/scala/net/kemitix/s3thorp/aws/lib/UploaderLogging.scala rename to aws-lib/src/main/scala/net/kemitix/thorp/aws/lib/UploaderLogging.scala index ab3d8b1..12c68e9 100644 --- a/aws-lib/src/main/scala/net/kemitix/s3thorp/aws/lib/UploaderLogging.scala +++ b/aws-lib/src/main/scala/net/kemitix/thorp/aws/lib/UploaderLogging.scala @@ -1,9 +1,9 @@ -package net.kemitix.s3thorp.aws.lib +package net.kemitix.thorp.aws.lib import cats.Monad -import net.kemitix.s3thorp.domain.Terminal.clearLine -import net.kemitix.s3thorp.domain.SizeTranslation.sizeInEnglish -import net.kemitix.s3thorp.domain.{LocalFile, Logger} +import net.kemitix.thorp.domain.SizeTranslation.sizeInEnglish +import net.kemitix.thorp.domain.Terminal.clearLine +import net.kemitix.thorp.domain.{LocalFile, Logger} object UploaderLogging { diff --git a/aws-lib/src/test/resources/net/kemitix/s3thorp/aws/lib/big-file b/aws-lib/src/test/resources/net/kemitix/thorp/aws/lib/big-file similarity index 100% rename from aws-lib/src/test/resources/net/kemitix/s3thorp/aws/lib/big-file rename to aws-lib/src/test/resources/net/kemitix/thorp/aws/lib/big-file diff --git a/aws-lib/src/test/resources/net/kemitix/s3thorp/aws/lib/small-file b/aws-lib/src/test/resources/net/kemitix/thorp/aws/lib/small-file similarity index 100% rename from aws-lib/src/test/resources/net/kemitix/s3thorp/aws/lib/small-file rename to aws-lib/src/test/resources/net/kemitix/thorp/aws/lib/small-file diff --git a/aws-lib/src/test/resources/net/kemitix/s3thorp/aws/lib/test-file-for-hash.txt b/aws-lib/src/test/resources/net/kemitix/thorp/aws/lib/test-file-for-hash.txt similarity index 100% rename from aws-lib/src/test/resources/net/kemitix/s3thorp/aws/lib/test-file-for-hash.txt rename to aws-lib/src/test/resources/net/kemitix/thorp/aws/lib/test-file-for-hash.txt diff --git a/aws-lib/src/test/resources/net/kemitix/s3thorp/aws/lib/upload/root-file b/aws-lib/src/test/resources/net/kemitix/thorp/aws/lib/upload/root-file similarity index 100% rename from aws-lib/src/test/resources/net/kemitix/s3thorp/aws/lib/upload/root-file rename to aws-lib/src/test/resources/net/kemitix/thorp/aws/lib/upload/root-file diff --git a/aws-lib/src/test/resources/net/kemitix/s3thorp/aws/lib/upload/subdir/leaf-file b/aws-lib/src/test/resources/net/kemitix/thorp/aws/lib/upload/subdir/leaf-file similarity index 100% rename from aws-lib/src/test/resources/net/kemitix/s3thorp/aws/lib/upload/subdir/leaf-file rename to aws-lib/src/test/resources/net/kemitix/thorp/aws/lib/upload/subdir/leaf-file diff --git a/core/src/test/scala/net/kemitix/s3thorp/core/DummyLogger.scala b/aws-lib/src/test/scala/net/kemitix/thorp/aws/lib/DummyLogger.scala similarity index 81% rename from core/src/test/scala/net/kemitix/s3thorp/core/DummyLogger.scala rename to aws-lib/src/test/scala/net/kemitix/thorp/aws/lib/DummyLogger.scala index b7191c5..42b7507 100644 --- a/core/src/test/scala/net/kemitix/s3thorp/core/DummyLogger.scala +++ b/aws-lib/src/test/scala/net/kemitix/thorp/aws/lib/DummyLogger.scala @@ -1,7 +1,7 @@ -package net.kemitix.s3thorp.core +package net.kemitix.thorp.aws.lib import cats.Monad -import net.kemitix.s3thorp.domain.Logger +import net.kemitix.thorp.domain.Logger class DummyLogger[M[_]: Monad] extends Logger[M] { diff --git a/core/src/test/scala/net/kemitix/s3thorp/core/MD5HashData.scala b/aws-lib/src/test/scala/net/kemitix/thorp/aws/lib/MD5HashData.scala similarity index 66% rename from core/src/test/scala/net/kemitix/s3thorp/core/MD5HashData.scala rename to aws-lib/src/test/scala/net/kemitix/thorp/aws/lib/MD5HashData.scala index 3b104b4..7caef4c 100644 --- a/core/src/test/scala/net/kemitix/s3thorp/core/MD5HashData.scala +++ b/aws-lib/src/test/scala/net/kemitix/thorp/aws/lib/MD5HashData.scala @@ -1,6 +1,6 @@ -package net.kemitix.s3thorp.core +package net.kemitix.thorp.aws.lib -import net.kemitix.s3thorp.domain.MD5Hash +import net.kemitix.thorp.domain.MD5Hash object MD5HashData { diff --git a/aws-lib/src/test/scala/net/kemitix/s3thorp/aws/lib/S3ClientSuite.scala b/aws-lib/src/test/scala/net/kemitix/thorp/aws/lib/S3ClientSuite.scala similarity index 92% rename from aws-lib/src/test/scala/net/kemitix/s3thorp/aws/lib/S3ClientSuite.scala rename to aws-lib/src/test/scala/net/kemitix/thorp/aws/lib/S3ClientSuite.scala index f2c8821..1e7d757 100644 --- a/aws-lib/src/test/scala/net/kemitix/s3thorp/aws/lib/S3ClientSuite.scala +++ b/aws-lib/src/test/scala/net/kemitix/thorp/aws/lib/S3ClientSuite.scala @@ -1,4 +1,4 @@ -package net.kemitix.s3thorp.aws.lib +package net.kemitix.thorp.aws.lib import java.time.Instant @@ -7,11 +7,11 @@ import com.amazonaws.services.s3.AmazonS3 import com.amazonaws.services.s3.model.PutObjectRequest import com.amazonaws.services.s3.transfer.model.UploadResult import com.amazonaws.services.s3.transfer.{TransferManager, Upload} -import net.kemitix.s3thorp.aws.api.S3Action.UploadS3Action -import net.kemitix.s3thorp.aws.api.{S3Client, UploadProgressListener} -import net.kemitix.s3thorp.aws.lib.MD5HashData.rootHash -import net.kemitix.s3thorp.core.{KeyGenerator, Resource, S3MetaDataEnricher} -import net.kemitix.s3thorp.domain._ +import net.kemitix.thorp.aws.api.S3Action.UploadS3Action +import net.kemitix.thorp.aws.api.{S3Client, UploadProgressListener} +import net.kemitix.thorp.aws.lib.MD5HashData.rootHash +import net.kemitix.thorp.core.{KeyGenerator, Resource, S3MetaDataEnricher} +import net.kemitix.thorp.domain._ import org.scalamock.scalatest.MockFactory import org.scalatest.FunSpec diff --git a/aws-lib/src/test/scala/net/kemitix/s3thorp/aws/lib/S3ObjectsByHashSuite.scala b/aws-lib/src/test/scala/net/kemitix/thorp/aws/lib/S3ObjectsByHashSuite.scala similarity index 91% rename from aws-lib/src/test/scala/net/kemitix/s3thorp/aws/lib/S3ObjectsByHashSuite.scala rename to aws-lib/src/test/scala/net/kemitix/thorp/aws/lib/S3ObjectsByHashSuite.scala index 518de05..74bc43f 100644 --- a/aws-lib/src/test/scala/net/kemitix/s3thorp/aws/lib/S3ObjectsByHashSuite.scala +++ b/aws-lib/src/test/scala/net/kemitix/thorp/aws/lib/S3ObjectsByHashSuite.scala @@ -1,11 +1,11 @@ -package net.kemitix.s3thorp.aws.lib +package net.kemitix.thorp.aws.lib import java.time.Instant import java.time.temporal.ChronoUnit import java.util.Date import com.amazonaws.services.s3.model.S3ObjectSummary -import net.kemitix.s3thorp.domain.{KeyModified, LastModified, MD5Hash, RemoteKey} +import net.kemitix.thorp.domain.{KeyModified, LastModified, MD5Hash, RemoteKey} import org.scalatest.FunSpec class S3ObjectsByHashSuite extends FunSpec { diff --git a/aws-lib/src/test/scala/net/kemitix/s3thorp/aws/lib/ThorpS3ClientSuite.scala b/aws-lib/src/test/scala/net/kemitix/thorp/aws/lib/ThorpS3ClientSuite.scala similarity index 95% rename from aws-lib/src/test/scala/net/kemitix/s3thorp/aws/lib/ThorpS3ClientSuite.scala rename to aws-lib/src/test/scala/net/kemitix/thorp/aws/lib/ThorpS3ClientSuite.scala index 03bd7d7..8cb3507 100644 --- a/aws-lib/src/test/scala/net/kemitix/s3thorp/aws/lib/ThorpS3ClientSuite.scala +++ b/aws-lib/src/test/scala/net/kemitix/thorp/aws/lib/ThorpS3ClientSuite.scala @@ -1,4 +1,4 @@ -package net.kemitix.s3thorp.aws.lib +package net.kemitix.thorp.aws.lib import java.time.Instant import java.time.temporal.ChronoUnit @@ -8,8 +8,8 @@ import cats.Id import com.amazonaws.services.s3.AmazonS3 import com.amazonaws.services.s3.model.{ListObjectsV2Request, ListObjectsV2Result, S3ObjectSummary} import com.amazonaws.services.s3.transfer.TransferManager -import net.kemitix.s3thorp.core.Resource -import net.kemitix.s3thorp.domain._ +import net.kemitix.thorp.core.Resource +import net.kemitix.thorp.domain._ import org.scalamock.scalatest.MockFactory import org.scalatest.FunSpec diff --git a/aws-lib/src/test/scala/net/kemitix/s3thorp/aws/lib/UploaderSuite.scala b/aws-lib/src/test/scala/net/kemitix/thorp/aws/lib/UploaderSuite.scala similarity index 90% rename from aws-lib/src/test/scala/net/kemitix/s3thorp/aws/lib/UploaderSuite.scala rename to aws-lib/src/test/scala/net/kemitix/thorp/aws/lib/UploaderSuite.scala index d2d5cde..c9f04fe 100644 --- a/aws-lib/src/test/scala/net/kemitix/s3thorp/aws/lib/UploaderSuite.scala +++ b/aws-lib/src/test/scala/net/kemitix/thorp/aws/lib/UploaderSuite.scala @@ -1,15 +1,15 @@ -package net.kemitix.s3thorp.aws.lib +package net.kemitix.thorp.aws.lib import java.time.Instant import cats.Id import com.amazonaws.services.s3.AmazonS3 import com.amazonaws.services.s3.transfer._ -import net.kemitix.s3thorp.aws.api.S3Action.UploadS3Action -import net.kemitix.s3thorp.aws.api.UploadProgressListener -import net.kemitix.s3thorp.core.KeyGenerator.generateKey -import net.kemitix.s3thorp.core.Resource -import net.kemitix.s3thorp.domain._ +import net.kemitix.thorp.aws.api.S3Action.UploadS3Action +import net.kemitix.thorp.aws.api.UploadProgressListener +import net.kemitix.thorp.core.KeyGenerator.generateKey +import net.kemitix.thorp.core.Resource +import net.kemitix.thorp.domain._ import org.scalamock.scalatest.MockFactory import org.scalatest.FunSpec diff --git a/bin/s3thorp b/bin/thorp similarity index 60% rename from bin/s3thorp rename to bin/thorp index e4a3931..482fcd7 100755 --- a/bin/s3thorp +++ b/bin/thorp @@ -1,4 +1,4 @@ #!/usr/bin/env sh THORP_HOME=`dirname $0` eval `resize` -java -jar $THORP_HOME/s3thorp.jar $* +java -jar $THORP_HOME/thorp.jar $* diff --git a/build.sbt b/build.sbt index 8ebc47c..5bf9cc8 100644 --- a/build.sbt +++ b/build.sbt @@ -6,7 +6,7 @@ val commonSettings = Seq( ) val applicationSettings = Seq( - name := "s3thorp", + name := "thorp", ) val testDependencies = Seq( libraryDependencies ++= Seq( @@ -58,7 +58,7 @@ val catsEffectsSettings = Seq( lazy val cli = (project in file("cli")) .settings(commonSettings) - .settings(mainClass in assembly := Some("net.kemitix.s3thorp.cli.Main")) + .settings(mainClass in assembly := Some("net.kemitix.thorp.cli.Main")) .settings(applicationSettings) .settings(catsEffectsSettings) .aggregate(`aws-lib`, core, `aws-api`, domain) diff --git a/cli/src/main/scala/net/kemitix/s3thorp/cli/Main.scala b/cli/src/main/scala/net/kemitix/thorp/cli/Main.scala similarity index 89% rename from cli/src/main/scala/net/kemitix/s3thorp/cli/Main.scala rename to cli/src/main/scala/net/kemitix/thorp/cli/Main.scala index 3c300b8..e9913ea 100644 --- a/cli/src/main/scala/net/kemitix/s3thorp/cli/Main.scala +++ b/cli/src/main/scala/net/kemitix/thorp/cli/Main.scala @@ -1,10 +1,10 @@ -package net.kemitix.s3thorp.cli +package net.kemitix.thorp.cli import java.nio.file.Paths import cats.effect.ExitCase.{Canceled, Completed, Error} import cats.effect.{ExitCode, IO, IOApp} -import net.kemitix.s3thorp.domain.Config +import net.kemitix.thorp.domain.Config object Main extends IOApp { diff --git a/cli/src/main/scala/net/kemitix/s3thorp/cli/ParseArgs.scala b/cli/src/main/scala/net/kemitix/thorp/cli/ParseArgs.scala similarity index 87% rename from cli/src/main/scala/net/kemitix/s3thorp/cli/ParseArgs.scala rename to cli/src/main/scala/net/kemitix/thorp/cli/ParseArgs.scala index f64a4e8..3c6133d 100644 --- a/cli/src/main/scala/net/kemitix/s3thorp/cli/ParseArgs.scala +++ b/cli/src/main/scala/net/kemitix/thorp/cli/ParseArgs.scala @@ -1,10 +1,10 @@ -package net.kemitix.s3thorp.cli +package net.kemitix.thorp.cli import java.io.File import java.nio.file.Paths -import net.kemitix.s3thorp.domain.Filter.{Exclude, Include} -import net.kemitix.s3thorp.domain.{Bucket, Config, RemoteKey} +import net.kemitix.thorp.domain.Filter.{Exclude, Include} +import net.kemitix.thorp.domain.{Bucket, Config, RemoteKey} import scopt.OParser object ParseArgs { @@ -13,8 +13,8 @@ object ParseArgs { val parserBuilder = OParser.builder[Config] import parserBuilder._ OParser.sequence( - programName("s3thorp"), - head("s3thorp"), + programName("thorp"), + head("thorp"), opt[String]('s', "source") .action((str, c) => c.copy(source = Paths.get(str).toFile)) .validate(s => if (new File(s).isDirectory) Right(()) else Left("Source is not a directory")) diff --git a/cli/src/main/scala/net/kemitix/s3thorp/cli/PrintLogger.scala b/cli/src/main/scala/net/kemitix/thorp/cli/PrintLogger.scala similarity index 87% rename from cli/src/main/scala/net/kemitix/s3thorp/cli/PrintLogger.scala rename to cli/src/main/scala/net/kemitix/thorp/cli/PrintLogger.scala index 49179ba..e37c15a 100644 --- a/cli/src/main/scala/net/kemitix/s3thorp/cli/PrintLogger.scala +++ b/cli/src/main/scala/net/kemitix/thorp/cli/PrintLogger.scala @@ -1,7 +1,7 @@ -package net.kemitix.s3thorp.cli +package net.kemitix.thorp.cli import cats.Monad -import net.kemitix.s3thorp.domain.Logger +import net.kemitix.thorp.domain.Logger class PrintLogger[M[_]: Monad](isDebug: Boolean) extends Logger[M] { diff --git a/cli/src/main/scala/net/kemitix/s3thorp/cli/Program.scala b/cli/src/main/scala/net/kemitix/thorp/cli/Program.scala similarity index 58% rename from cli/src/main/scala/net/kemitix/s3thorp/cli/Program.scala rename to cli/src/main/scala/net/kemitix/thorp/cli/Program.scala index 871bf84..2395f13 100644 --- a/cli/src/main/scala/net/kemitix/s3thorp/cli/Program.scala +++ b/cli/src/main/scala/net/kemitix/thorp/cli/Program.scala @@ -1,18 +1,18 @@ -package net.kemitix.s3thorp.cli +package net.kemitix.thorp.cli import cats.Monad import cats.effect.ExitCode import cats.implicits._ -import net.kemitix.s3thorp.aws.lib.S3ClientBuilder -import net.kemitix.s3thorp.core.Sync -import net.kemitix.s3thorp.domain.{Config, Logger} +import net.kemitix.thorp.aws.lib.S3ClientBuilder +import net.kemitix.thorp.core.Sync +import net.kemitix.thorp.domain.{Config, Logger} object Program { def apply[M[_]: Monad](config: Config): M[ExitCode] = { implicit val logger: Logger[M] = new PrintLogger[M](config.debug) for { - _ <- logger.info("S3Thorp - hashed sync for s3") + _ <- logger.info("Thorp - hashed sync for cloud storage") _ <- Sync.run[M](config, S3ClientBuilder.defaultClient) } yield ExitCode.Success } diff --git a/cli/src/test/scala/net/kemitix/s3thorp/cli/ParseArgsTest.scala b/cli/src/test/scala/net/kemitix/thorp/cli/ParseArgsTest.scala similarity index 94% rename from cli/src/test/scala/net/kemitix/s3thorp/cli/ParseArgsTest.scala rename to cli/src/test/scala/net/kemitix/thorp/cli/ParseArgsTest.scala index 142d5b5..2efbec1 100644 --- a/cli/src/test/scala/net/kemitix/s3thorp/cli/ParseArgsTest.scala +++ b/cli/src/test/scala/net/kemitix/thorp/cli/ParseArgsTest.scala @@ -1,7 +1,7 @@ -package net.kemitix.s3thorp.cli +package net.kemitix.thorp.cli -import net.kemitix.s3thorp.core.Resource -import net.kemitix.s3thorp.domain.{Bucket, Config} +import net.kemitix.thorp.core.Resource +import net.kemitix.thorp.domain.Config import org.scalatest.FunSpec import scala.util.Try diff --git a/core/src/main/scala/net.kemitix.s3thorp.core/Action.scala b/core/src/main/scala/net/kemitix/thorp/core/Action.scala similarity index 84% rename from core/src/main/scala/net.kemitix.s3thorp.core/Action.scala rename to core/src/main/scala/net/kemitix/thorp/core/Action.scala index 08f91e5..eb5bf25 100644 --- a/core/src/main/scala/net.kemitix.s3thorp.core/Action.scala +++ b/core/src/main/scala/net/kemitix/thorp/core/Action.scala @@ -1,6 +1,6 @@ -package net.kemitix.s3thorp.core +package net.kemitix.thorp.core -import net.kemitix.s3thorp.domain.{Bucket, LocalFile, MD5Hash, RemoteKey} +import net.kemitix.thorp.domain.{Bucket, LocalFile, MD5Hash, RemoteKey} sealed trait Action { def bucket: Bucket diff --git a/core/src/main/scala/net.kemitix.s3thorp.core/ActionGenerator.scala b/core/src/main/scala/net/kemitix/thorp/core/ActionGenerator.scala similarity index 93% rename from core/src/main/scala/net.kemitix.s3thorp.core/ActionGenerator.scala rename to core/src/main/scala/net/kemitix/thorp/core/ActionGenerator.scala index 839d531..7ad6caa 100644 --- a/core/src/main/scala/net.kemitix.s3thorp.core/ActionGenerator.scala +++ b/core/src/main/scala/net/kemitix/thorp/core/ActionGenerator.scala @@ -1,7 +1,7 @@ -package net.kemitix.s3thorp.core +package net.kemitix.thorp.core -import net.kemitix.s3thorp.core.Action.{DoNothing, ToCopy, ToUpload} -import net.kemitix.s3thorp.domain._ +import net.kemitix.thorp.core.Action.{DoNothing, ToCopy, ToUpload} +import net.kemitix.thorp.domain._ object ActionGenerator { diff --git a/core/src/main/scala/net.kemitix.s3thorp.core/ActionSubmitter.scala b/core/src/main/scala/net/kemitix/thorp/core/ActionSubmitter.scala similarity index 79% rename from core/src/main/scala/net.kemitix.s3thorp.core/ActionSubmitter.scala rename to core/src/main/scala/net/kemitix/thorp/core/ActionSubmitter.scala index 2e05f83..2ba91dd 100644 --- a/core/src/main/scala/net.kemitix.s3thorp.core/ActionSubmitter.scala +++ b/core/src/main/scala/net/kemitix/thorp/core/ActionSubmitter.scala @@ -1,11 +1,11 @@ -package net.kemitix.s3thorp.core +package net.kemitix.thorp.core import cats.Monad import cats.implicits._ -import net.kemitix.s3thorp.aws.api.S3Action.DoNothingS3Action -import net.kemitix.s3thorp.aws.api.{S3Action, S3Client, UploadProgressListener} -import net.kemitix.s3thorp.core.Action.{DoNothing, ToCopy, ToDelete, ToUpload} -import net.kemitix.s3thorp.domain.{Config, Logger} +import net.kemitix.thorp.aws.api.S3Action.DoNothingS3Action +import net.kemitix.thorp.aws.api.{S3Action, S3Client, UploadProgressListener} +import net.kemitix.thorp.core.Action.{DoNothing, ToCopy, ToDelete, ToUpload} +import net.kemitix.thorp.domain.{Config, Logger} object ActionSubmitter { diff --git a/core/src/main/scala/net.kemitix.s3thorp.core/Counters.scala b/core/src/main/scala/net/kemitix/thorp/core/Counters.scala similarity index 84% rename from core/src/main/scala/net.kemitix.s3thorp.core/Counters.scala rename to core/src/main/scala/net/kemitix/thorp/core/Counters.scala index b8c89a2..9b4b850 100644 --- a/core/src/main/scala/net.kemitix.s3thorp.core/Counters.scala +++ b/core/src/main/scala/net/kemitix/thorp/core/Counters.scala @@ -1,4 +1,4 @@ -package net.kemitix.s3thorp.core +package net.kemitix.thorp.core final case class Counters(uploaded: Int = 0, deleted: Int = 0, diff --git a/core/src/main/scala/net.kemitix.s3thorp.core/KeyGenerator.scala b/core/src/main/scala/net/kemitix/thorp/core/KeyGenerator.scala similarity index 81% rename from core/src/main/scala/net.kemitix.s3thorp.core/KeyGenerator.scala rename to core/src/main/scala/net/kemitix/thorp/core/KeyGenerator.scala index 8a891be..25ceb1a 100644 --- a/core/src/main/scala/net.kemitix.s3thorp.core/KeyGenerator.scala +++ b/core/src/main/scala/net/kemitix/thorp/core/KeyGenerator.scala @@ -1,8 +1,8 @@ -package net.kemitix.s3thorp.core +package net.kemitix.thorp.core import java.io.File -import net.kemitix.s3thorp.domain.RemoteKey +import net.kemitix.thorp.domain.RemoteKey object KeyGenerator { diff --git a/core/src/main/scala/net.kemitix.s3thorp.core/LocalFileStream.scala b/core/src/main/scala/net/kemitix/thorp/core/LocalFileStream.scala similarity index 84% rename from core/src/main/scala/net.kemitix.s3thorp.core/LocalFileStream.scala rename to core/src/main/scala/net/kemitix/thorp/core/LocalFileStream.scala index fd434f7..52ea218 100644 --- a/core/src/main/scala/net.kemitix.s3thorp.core/LocalFileStream.scala +++ b/core/src/main/scala/net/kemitix/thorp/core/LocalFileStream.scala @@ -1,12 +1,13 @@ -package net.kemitix.s3thorp.core +package net.kemitix.thorp.core import java.io.File import java.nio.file.Path import cats.Monad import cats.implicits._ -import net.kemitix.s3thorp.core.KeyGenerator.generateKey -import net.kemitix.s3thorp.domain.{Config, Filter, LocalFile, Logger, MD5Hash} +import net.kemitix.thorp.core.KeyGenerator.generateKey +import net.kemitix.thorp.domain +import net.kemitix.thorp.domain._ object LocalFileStream { @@ -32,7 +33,7 @@ object LocalFileStream { file match { case f if f.isDirectory => loop(file) case _ => for(hash <- md5HashGenerator(file)) - yield Stream(LocalFile(file, c.source, hash, generateKey(c.source, c.prefix))) + yield Stream(domain.LocalFile(file, c.source, hash, generateKey(c.source, c.prefix))) } def recurse(fs: Stream[File]): M[Stream[LocalFile]] = diff --git a/core/src/main/scala/net.kemitix.s3thorp.core/MD5HashGenerator.scala b/core/src/main/scala/net/kemitix/thorp/core/MD5HashGenerator.scala similarity index 95% rename from core/src/main/scala/net.kemitix.s3thorp.core/MD5HashGenerator.scala rename to core/src/main/scala/net/kemitix/thorp/core/MD5HashGenerator.scala index 95ac20b..321ec46 100644 --- a/core/src/main/scala/net.kemitix.s3thorp.core/MD5HashGenerator.scala +++ b/core/src/main/scala/net/kemitix/thorp/core/MD5HashGenerator.scala @@ -1,11 +1,11 @@ -package net.kemitix.s3thorp.core +package net.kemitix.thorp.core import java.io.{File, FileInputStream} import java.security.MessageDigest import cats.Monad import cats.implicits._ -import net.kemitix.s3thorp.domain.{Logger, MD5Hash} +import net.kemitix.thorp.domain.{Logger, MD5Hash} import scala.collection.immutable.NumericRange diff --git a/core/src/main/scala/net.kemitix.s3thorp.core/Resource.scala b/core/src/main/scala/net/kemitix/thorp/core/Resource.scala similarity index 89% rename from core/src/main/scala/net.kemitix.s3thorp.core/Resource.scala rename to core/src/main/scala/net/kemitix/thorp/core/Resource.scala index 670c6fc..d0360cd 100644 --- a/core/src/main/scala/net.kemitix.s3thorp.core/Resource.scala +++ b/core/src/main/scala/net/kemitix/thorp/core/Resource.scala @@ -1,4 +1,4 @@ -package net.kemitix.s3thorp.core +package net.kemitix.thorp.core import java.io.{File, FileNotFoundException} diff --git a/core/src/main/scala/net.kemitix.s3thorp.core/S3MetaDataEnricher.scala b/core/src/main/scala/net/kemitix/thorp/core/S3MetaDataEnricher.scala similarity index 92% rename from core/src/main/scala/net.kemitix.s3thorp.core/S3MetaDataEnricher.scala rename to core/src/main/scala/net/kemitix/thorp/core/S3MetaDataEnricher.scala index 53c3770..fc220e8 100644 --- a/core/src/main/scala/net.kemitix.s3thorp.core/S3MetaDataEnricher.scala +++ b/core/src/main/scala/net/kemitix/thorp/core/S3MetaDataEnricher.scala @@ -1,6 +1,6 @@ -package net.kemitix.s3thorp.core +package net.kemitix.thorp.core -import net.kemitix.s3thorp.domain._ +import net.kemitix.thorp.domain._ object S3MetaDataEnricher { diff --git a/core/src/main/scala/net.kemitix.s3thorp.core/Sync.scala b/core/src/main/scala/net/kemitix/thorp/core/Sync.scala similarity index 76% rename from core/src/main/scala/net.kemitix.s3thorp.core/Sync.scala rename to core/src/main/scala/net/kemitix/thorp/core/Sync.scala index 5fd5d89..41cd855 100644 --- a/core/src/main/scala/net.kemitix.s3thorp.core/Sync.scala +++ b/core/src/main/scala/net/kemitix/thorp/core/Sync.scala @@ -1,15 +1,15 @@ -package net.kemitix.s3thorp.core +package net.kemitix.thorp.core import cats.Monad import cats.implicits._ -import net.kemitix.s3thorp.aws.api.{S3Action, S3Client} -import net.kemitix.s3thorp.core.Action.ToDelete -import net.kemitix.s3thorp.core.ActionGenerator.createActions -import net.kemitix.s3thorp.core.ActionSubmitter.submitAction -import net.kemitix.s3thorp.core.LocalFileStream.findFiles -import net.kemitix.s3thorp.core.S3MetaDataEnricher.getMetadata -import net.kemitix.s3thorp.core.SyncLogging.{logFileScan, logRunFinished, logRunStart} -import net.kemitix.s3thorp.domain._ +import net.kemitix.thorp.aws.api.{S3Action, S3Client} +import net.kemitix.thorp.core.Action.ToDelete +import net.kemitix.thorp.core.ActionGenerator.createActions +import net.kemitix.thorp.core.ActionSubmitter.submitAction +import net.kemitix.thorp.core.LocalFileStream.findFiles +import net.kemitix.thorp.core.S3MetaDataEnricher.getMetadata +import net.kemitix.thorp.core.SyncLogging.{logFileScan, logRunFinished, logRunStart} +import net.kemitix.thorp.domain._ object Sync { diff --git a/core/src/main/scala/net.kemitix.s3thorp.core/SyncLogging.scala b/core/src/main/scala/net/kemitix/thorp/core/SyncLogging.scala similarity index 86% rename from core/src/main/scala/net.kemitix.s3thorp.core/SyncLogging.scala rename to core/src/main/scala/net/kemitix/thorp/core/SyncLogging.scala index e121b2b..3c077bb 100644 --- a/core/src/main/scala/net.kemitix.s3thorp.core/SyncLogging.scala +++ b/core/src/main/scala/net/kemitix/thorp/core/SyncLogging.scala @@ -1,10 +1,10 @@ -package net.kemitix.s3thorp.core +package net.kemitix.thorp.core import cats.Monad import cats.implicits._ -import net.kemitix.s3thorp.aws.api.S3Action -import net.kemitix.s3thorp.aws.api.S3Action.{CopyS3Action, DeleteS3Action, ErroredS3Action, UploadS3Action} -import net.kemitix.s3thorp.domain.{Config, Logger} +import net.kemitix.thorp.aws.api.S3Action +import net.kemitix.thorp.aws.api.S3Action.{CopyS3Action, DeleteS3Action, ErroredS3Action, UploadS3Action} +import net.kemitix.thorp.domain.{Config, Logger} // Logging for the Sync class object SyncLogging { diff --git a/core/src/test/resources/net/kemitix/s3thorp/core/big-file b/core/src/test/resources/net/kemitix/thorp/core/big-file similarity index 100% rename from core/src/test/resources/net/kemitix/s3thorp/core/big-file rename to core/src/test/resources/net/kemitix/thorp/core/big-file diff --git a/core/src/test/resources/net/kemitix/s3thorp/core/small-file b/core/src/test/resources/net/kemitix/thorp/core/small-file similarity index 100% rename from core/src/test/resources/net/kemitix/s3thorp/core/small-file rename to core/src/test/resources/net/kemitix/thorp/core/small-file diff --git a/core/src/test/resources/net/kemitix/s3thorp/core/upload/root-file b/core/src/test/resources/net/kemitix/thorp/core/upload/root-file similarity index 100% rename from core/src/test/resources/net/kemitix/s3thorp/core/upload/root-file rename to core/src/test/resources/net/kemitix/thorp/core/upload/root-file diff --git a/core/src/test/resources/net/kemitix/s3thorp/core/upload/subdir/leaf-file b/core/src/test/resources/net/kemitix/thorp/core/upload/subdir/leaf-file similarity index 100% rename from core/src/test/resources/net/kemitix/s3thorp/core/upload/subdir/leaf-file rename to core/src/test/resources/net/kemitix/thorp/core/upload/subdir/leaf-file diff --git a/core/src/test/scala/net/kemitix/s3thorp/core/ActionGeneratorSuite.scala b/core/src/test/scala/net/kemitix/thorp/core/ActionGeneratorSuite.scala similarity index 97% rename from core/src/test/scala/net/kemitix/s3thorp/core/ActionGeneratorSuite.scala rename to core/src/test/scala/net/kemitix/thorp/core/ActionGeneratorSuite.scala index 3e6ebc7..199ad99 100644 --- a/core/src/test/scala/net/kemitix/s3thorp/core/ActionGeneratorSuite.scala +++ b/core/src/test/scala/net/kemitix/thorp/core/ActionGeneratorSuite.scala @@ -1,9 +1,9 @@ -package net.kemitix.s3thorp.core +package net.kemitix.thorp.core import java.time.Instant -import net.kemitix.s3thorp.core.Action.{DoNothing, ToCopy, ToUpload} -import net.kemitix.s3thorp.domain._ +import net.kemitix.thorp.core.Action.{DoNothing, ToCopy, ToUpload} +import net.kemitix.thorp.domain._ import org.scalatest.FunSpec class ActionGeneratorSuite diff --git a/aws-lib/src/test/scala/net/kemitix/s3thorp/aws/lib/DummyLogger.scala b/core/src/test/scala/net/kemitix/thorp/core/DummyLogger.scala similarity index 81% rename from aws-lib/src/test/scala/net/kemitix/s3thorp/aws/lib/DummyLogger.scala rename to core/src/test/scala/net/kemitix/thorp/core/DummyLogger.scala index ff4cf04..de2449e 100644 --- a/aws-lib/src/test/scala/net/kemitix/s3thorp/aws/lib/DummyLogger.scala +++ b/core/src/test/scala/net/kemitix/thorp/core/DummyLogger.scala @@ -1,7 +1,7 @@ -package net.kemitix.s3thorp.aws.lib +package net.kemitix.thorp.core import cats.Monad -import net.kemitix.s3thorp.domain.Logger +import net.kemitix.thorp.domain.Logger class DummyLogger[M[_]: Monad] extends Logger[M] { diff --git a/core/src/test/scala/net/kemitix/s3thorp/core/KeyGeneratorSuite.scala b/core/src/test/scala/net/kemitix/thorp/core/KeyGeneratorSuite.scala similarity index 91% rename from core/src/test/scala/net/kemitix/s3thorp/core/KeyGeneratorSuite.scala rename to core/src/test/scala/net/kemitix/thorp/core/KeyGeneratorSuite.scala index 9c14331..73119cd 100644 --- a/core/src/test/scala/net/kemitix/s3thorp/core/KeyGeneratorSuite.scala +++ b/core/src/test/scala/net/kemitix/thorp/core/KeyGeneratorSuite.scala @@ -1,8 +1,8 @@ -package net.kemitix.s3thorp.core +package net.kemitix.thorp.core import java.io.File -import net.kemitix.s3thorp.domain.{Bucket, Config, RemoteKey} +import net.kemitix.thorp.domain.{Bucket, Config, RemoteKey} import org.scalatest.FunSpec class KeyGeneratorSuite extends FunSpec { diff --git a/core/src/test/scala/net/kemitix/s3thorp/core/LocalFileStreamSuite.scala b/core/src/test/scala/net/kemitix/thorp/core/LocalFileStreamSuite.scala similarity index 86% rename from core/src/test/scala/net/kemitix/s3thorp/core/LocalFileStreamSuite.scala rename to core/src/test/scala/net/kemitix/thorp/core/LocalFileStreamSuite.scala index af95145..beddece 100644 --- a/core/src/test/scala/net/kemitix/s3thorp/core/LocalFileStreamSuite.scala +++ b/core/src/test/scala/net/kemitix/thorp/core/LocalFileStreamSuite.scala @@ -1,9 +1,9 @@ -package net.kemitix.s3thorp.core +package net.kemitix.thorp.core import java.io.File import cats.Id -import net.kemitix.s3thorp.domain.{Config, LocalFile, Logger, MD5Hash} +import net.kemitix.thorp.domain.{Config, LocalFile, Logger, MD5Hash} import org.scalatest.FunSpec class LocalFileStreamSuite extends FunSpec { diff --git a/aws-lib/src/test/scala/net/kemitix/s3thorp/aws/lib/MD5HashData.scala b/core/src/test/scala/net/kemitix/thorp/core/MD5HashData.scala similarity index 65% rename from aws-lib/src/test/scala/net/kemitix/s3thorp/aws/lib/MD5HashData.scala rename to core/src/test/scala/net/kemitix/thorp/core/MD5HashData.scala index a4e7c04..4c38e63 100644 --- a/aws-lib/src/test/scala/net/kemitix/s3thorp/aws/lib/MD5HashData.scala +++ b/core/src/test/scala/net/kemitix/thorp/core/MD5HashData.scala @@ -1,6 +1,6 @@ -package net.kemitix.s3thorp.aws.lib +package net.kemitix.thorp.core -import net.kemitix.s3thorp.domain.MD5Hash +import net.kemitix.thorp.domain.MD5Hash object MD5HashData { diff --git a/core/src/test/scala/net/kemitix/s3thorp/core/MD5HashGeneratorTest.scala b/core/src/test/scala/net/kemitix/thorp/core/MD5HashGeneratorTest.scala similarity index 84% rename from core/src/test/scala/net/kemitix/s3thorp/core/MD5HashGeneratorTest.scala rename to core/src/test/scala/net/kemitix/thorp/core/MD5HashGeneratorTest.scala index a71b57a..4bbc8ec 100644 --- a/core/src/test/scala/net/kemitix/s3thorp/core/MD5HashGeneratorTest.scala +++ b/core/src/test/scala/net/kemitix/thorp/core/MD5HashGeneratorTest.scala @@ -1,8 +1,8 @@ -package net.kemitix.s3thorp.core +package net.kemitix.thorp.core import cats.Id -import net.kemitix.s3thorp.core.MD5HashData.rootHash -import net.kemitix.s3thorp.domain.{Bucket, Config, Logger, MD5Hash, RemoteKey} +import net.kemitix.thorp.core.MD5HashData.rootHash +import net.kemitix.thorp.domain._ import org.scalatest.FunSpec class MD5HashGeneratorTest extends FunSpec { diff --git a/core/src/test/scala/net/kemitix/s3thorp/core/S3ActionSuite.scala b/core/src/test/scala/net/kemitix/thorp/core/S3ActionSuite.scala similarity index 75% rename from core/src/test/scala/net/kemitix/s3thorp/core/S3ActionSuite.scala rename to core/src/test/scala/net/kemitix/thorp/core/S3ActionSuite.scala index e72c03b..36834a7 100644 --- a/core/src/test/scala/net/kemitix/s3thorp/core/S3ActionSuite.scala +++ b/core/src/test/scala/net/kemitix/thorp/core/S3ActionSuite.scala @@ -1,7 +1,7 @@ -package net.kemitix.s3thorp.core +package net.kemitix.thorp.core -import net.kemitix.s3thorp.aws.api.S3Action.{CopyS3Action, DeleteS3Action, UploadS3Action} -import net.kemitix.s3thorp.domain.{MD5Hash, RemoteKey} +import net.kemitix.thorp.aws.api.S3Action.{CopyS3Action, DeleteS3Action, UploadS3Action} +import net.kemitix.thorp.domain.{MD5Hash, RemoteKey} import org.scalatest.FunSpec class S3ActionSuite extends FunSpec { diff --git a/core/src/test/scala/net/kemitix/s3thorp/core/S3MetaDataEnricherSuite.scala b/core/src/test/scala/net/kemitix/thorp/core/S3MetaDataEnricherSuite.scala similarity index 98% rename from core/src/test/scala/net/kemitix/s3thorp/core/S3MetaDataEnricherSuite.scala rename to core/src/test/scala/net/kemitix/thorp/core/S3MetaDataEnricherSuite.scala index 8ed0610..c07de3e 100644 --- a/core/src/test/scala/net/kemitix/s3thorp/core/S3MetaDataEnricherSuite.scala +++ b/core/src/test/scala/net/kemitix/thorp/core/S3MetaDataEnricherSuite.scala @@ -1,9 +1,9 @@ -package net.kemitix.s3thorp.core +package net.kemitix.thorp.core import java.time.Instant -import net.kemitix.s3thorp.core.S3MetaDataEnricher.{getMetadata, getS3Status} -import net.kemitix.s3thorp.domain._ +import net.kemitix.thorp.core.S3MetaDataEnricher.{getMetadata, getS3Status} +import net.kemitix.thorp.domain._ import org.scalatest.FunSpec class S3MetaDataEnricherSuite diff --git a/core/src/test/scala/net/kemitix/s3thorp/core/SyncSuite.scala b/core/src/test/scala/net/kemitix/thorp/core/SyncSuite.scala similarity index 95% rename from core/src/test/scala/net/kemitix/s3thorp/core/SyncSuite.scala rename to core/src/test/scala/net/kemitix/thorp/core/SyncSuite.scala index a0e3658..bc28da7 100644 --- a/core/src/test/scala/net/kemitix/s3thorp/core/SyncSuite.scala +++ b/core/src/test/scala/net/kemitix/thorp/core/SyncSuite.scala @@ -1,14 +1,14 @@ -package net.kemitix.s3thorp.core +package net.kemitix.thorp.core import java.io.File import java.time.Instant import cats.Id -import net.kemitix.s3thorp.aws.api.S3Action.{CopyS3Action, DeleteS3Action, UploadS3Action} -import net.kemitix.s3thorp.aws.api.{S3Client, UploadProgressListener} -import net.kemitix.s3thorp.core.MD5HashData.{leafHash, rootHash} -import net.kemitix.s3thorp.domain.Filter.Exclude -import net.kemitix.s3thorp.domain._ +import net.kemitix.thorp.aws.api.S3Action.{CopyS3Action, DeleteS3Action, UploadS3Action} +import net.kemitix.thorp.aws.api.{S3Client, UploadProgressListener} +import net.kemitix.thorp.core.MD5HashData.{leafHash, rootHash} +import net.kemitix.thorp.domain.Filter.Exclude +import net.kemitix.thorp.domain._ import org.scalatest.FunSpec class SyncSuite diff --git a/domain/src/main/scala/net/kemitix/s3thorp/domain/MD5Hash.scala b/domain/src/main/scala/net/kemitix/s3thorp/domain/MD5Hash.scala deleted file mode 100644 index f37e201..0000000 --- a/domain/src/main/scala/net/kemitix/s3thorp/domain/MD5Hash.scala +++ /dev/null @@ -1,9 +0,0 @@ -package net.kemitix.s3thorp.domain - -import net.kemitix.s3thorp.domain.QuoteStripper.stripQuotes - -final case class MD5Hash(in: String) { - - lazy val hash: String = in filter stripQuotes - -} diff --git a/domain/src/main/scala/net/kemitix/s3thorp/domain/Bucket.scala b/domain/src/main/scala/net/kemitix/thorp/domain/Bucket.scala similarity index 52% rename from domain/src/main/scala/net/kemitix/s3thorp/domain/Bucket.scala rename to domain/src/main/scala/net/kemitix/thorp/domain/Bucket.scala index b10a129..df3a2b6 100644 --- a/domain/src/main/scala/net/kemitix/s3thorp/domain/Bucket.scala +++ b/domain/src/main/scala/net/kemitix/thorp/domain/Bucket.scala @@ -1,3 +1,3 @@ -package net.kemitix.s3thorp.domain +package net.kemitix.thorp.domain final case class Bucket(name: String) diff --git a/domain/src/main/scala/net/kemitix/s3thorp/domain/Config.scala b/domain/src/main/scala/net/kemitix/thorp/domain/Config.scala similarity index 94% rename from domain/src/main/scala/net/kemitix/s3thorp/domain/Config.scala rename to domain/src/main/scala/net/kemitix/thorp/domain/Config.scala index 81ef071..072ae70 100644 --- a/domain/src/main/scala/net/kemitix/s3thorp/domain/Config.scala +++ b/domain/src/main/scala/net/kemitix/thorp/domain/Config.scala @@ -1,4 +1,4 @@ -package net.kemitix.s3thorp.domain +package net.kemitix.thorp.domain import java.io.File diff --git a/domain/src/main/scala/net/kemitix/s3thorp/domain/Filter.scala b/domain/src/main/scala/net/kemitix/thorp/domain/Filter.scala similarity index 97% rename from domain/src/main/scala/net/kemitix/s3thorp/domain/Filter.scala rename to domain/src/main/scala/net/kemitix/thorp/domain/Filter.scala index da87200..29ba873 100644 --- a/domain/src/main/scala/net/kemitix/s3thorp/domain/Filter.scala +++ b/domain/src/main/scala/net/kemitix/thorp/domain/Filter.scala @@ -1,4 +1,4 @@ -package net.kemitix.s3thorp.domain +package net.kemitix.thorp.domain import java.nio.file.Path import java.util.regex.Pattern diff --git a/domain/src/main/scala/net/kemitix/s3thorp/domain/HashModified.scala b/domain/src/main/scala/net/kemitix/thorp/domain/HashModified.scala similarity index 74% rename from domain/src/main/scala/net/kemitix/s3thorp/domain/HashModified.scala rename to domain/src/main/scala/net/kemitix/thorp/domain/HashModified.scala index 24ba44b..eff1841 100644 --- a/domain/src/main/scala/net/kemitix/s3thorp/domain/HashModified.scala +++ b/domain/src/main/scala/net/kemitix/thorp/domain/HashModified.scala @@ -1,4 +1,4 @@ -package net.kemitix.s3thorp.domain +package net.kemitix.thorp.domain final case class HashModified(hash: MD5Hash, modified: LastModified) diff --git a/domain/src/main/scala/net/kemitix/s3thorp/domain/KeyModified.scala b/domain/src/main/scala/net/kemitix/thorp/domain/KeyModified.scala similarity index 73% rename from domain/src/main/scala/net/kemitix/s3thorp/domain/KeyModified.scala rename to domain/src/main/scala/net/kemitix/thorp/domain/KeyModified.scala index de6139e..a920503 100644 --- a/domain/src/main/scala/net/kemitix/s3thorp/domain/KeyModified.scala +++ b/domain/src/main/scala/net/kemitix/thorp/domain/KeyModified.scala @@ -1,4 +1,4 @@ -package net.kemitix.s3thorp.domain +package net.kemitix.thorp.domain final case class KeyModified(key: RemoteKey, modified: LastModified) diff --git a/domain/src/main/scala/net/kemitix/s3thorp/domain/LastModified.scala b/domain/src/main/scala/net/kemitix/thorp/domain/LastModified.scala similarity index 67% rename from domain/src/main/scala/net/kemitix/s3thorp/domain/LastModified.scala rename to domain/src/main/scala/net/kemitix/thorp/domain/LastModified.scala index 0a4fc76..7c954c3 100644 --- a/domain/src/main/scala/net/kemitix/s3thorp/domain/LastModified.scala +++ b/domain/src/main/scala/net/kemitix/thorp/domain/LastModified.scala @@ -1,4 +1,4 @@ -package net.kemitix.s3thorp.domain +package net.kemitix.thorp.domain import java.time.Instant diff --git a/domain/src/main/scala/net/kemitix/s3thorp/domain/LocalFile.scala b/domain/src/main/scala/net/kemitix/thorp/domain/LocalFile.scala similarity index 95% rename from domain/src/main/scala/net/kemitix/s3thorp/domain/LocalFile.scala rename to domain/src/main/scala/net/kemitix/thorp/domain/LocalFile.scala index 664f8cf..b2e4719 100644 --- a/domain/src/main/scala/net/kemitix/s3thorp/domain/LocalFile.scala +++ b/domain/src/main/scala/net/kemitix/thorp/domain/LocalFile.scala @@ -1,4 +1,4 @@ -package net.kemitix.s3thorp.domain +package net.kemitix.thorp.domain import java.io.File import java.nio.file.Path diff --git a/domain/src/main/scala/net/kemitix/s3thorp/domain/Logger.scala b/domain/src/main/scala/net/kemitix/thorp/domain/Logger.scala similarity index 83% rename from domain/src/main/scala/net/kemitix/s3thorp/domain/Logger.scala rename to domain/src/main/scala/net/kemitix/thorp/domain/Logger.scala index b2fd355..d3196c1 100644 --- a/domain/src/main/scala/net/kemitix/s3thorp/domain/Logger.scala +++ b/domain/src/main/scala/net/kemitix/thorp/domain/Logger.scala @@ -1,4 +1,4 @@ -package net.kemitix.s3thorp.domain +package net.kemitix.thorp.domain trait Logger[M[_]] { diff --git a/domain/src/main/scala/net/kemitix/thorp/domain/MD5Hash.scala b/domain/src/main/scala/net/kemitix/thorp/domain/MD5Hash.scala new file mode 100644 index 0000000..0935c7a --- /dev/null +++ b/domain/src/main/scala/net/kemitix/thorp/domain/MD5Hash.scala @@ -0,0 +1,9 @@ +package net.kemitix.thorp.domain + +import net.kemitix.thorp.domain.QuoteStripper.stripQuotes + +final case class MD5Hash(in: String) { + + lazy val hash: String = in filter stripQuotes + +} diff --git a/domain/src/main/scala/net/kemitix/s3thorp/domain/QuoteStripper.scala b/domain/src/main/scala/net/kemitix/thorp/domain/QuoteStripper.scala similarity index 67% rename from domain/src/main/scala/net/kemitix/s3thorp/domain/QuoteStripper.scala rename to domain/src/main/scala/net/kemitix/thorp/domain/QuoteStripper.scala index c432fba..0271709 100644 --- a/domain/src/main/scala/net/kemitix/s3thorp/domain/QuoteStripper.scala +++ b/domain/src/main/scala/net/kemitix/thorp/domain/QuoteStripper.scala @@ -1,4 +1,4 @@ -package net.kemitix.s3thorp.domain +package net.kemitix.thorp.domain object QuoteStripper { diff --git a/domain/src/main/scala/net/kemitix/s3thorp/domain/RemoteKey.scala b/domain/src/main/scala/net/kemitix/thorp/domain/RemoteKey.scala similarity index 92% rename from domain/src/main/scala/net/kemitix/s3thorp/domain/RemoteKey.scala rename to domain/src/main/scala/net/kemitix/thorp/domain/RemoteKey.scala index 80235a4..599b6fe 100644 --- a/domain/src/main/scala/net/kemitix/s3thorp/domain/RemoteKey.scala +++ b/domain/src/main/scala/net/kemitix/thorp/domain/RemoteKey.scala @@ -1,4 +1,4 @@ -package net.kemitix.s3thorp.domain +package net.kemitix.thorp.domain import java.io.File import java.nio.file.Paths diff --git a/domain/src/main/scala/net/kemitix/s3thorp/domain/RemoteMetaData.scala b/domain/src/main/scala/net/kemitix/thorp/domain/RemoteMetaData.scala similarity index 82% rename from domain/src/main/scala/net/kemitix/s3thorp/domain/RemoteMetaData.scala rename to domain/src/main/scala/net/kemitix/thorp/domain/RemoteMetaData.scala index f499d16..87278b9 100644 --- a/domain/src/main/scala/net/kemitix/s3thorp/domain/RemoteMetaData.scala +++ b/domain/src/main/scala/net/kemitix/thorp/domain/RemoteMetaData.scala @@ -1,4 +1,4 @@ -package net.kemitix.s3thorp.domain +package net.kemitix.thorp.domain final case class RemoteMetaData(remoteKey: RemoteKey, hash: MD5Hash, diff --git a/domain/src/main/scala/net/kemitix/s3thorp/domain/S3MetaData.scala b/domain/src/main/scala/net/kemitix/thorp/domain/S3MetaData.scala similarity index 87% rename from domain/src/main/scala/net/kemitix/s3thorp/domain/S3MetaData.scala rename to domain/src/main/scala/net/kemitix/thorp/domain/S3MetaData.scala index 2fdb3b0..723965c 100644 --- a/domain/src/main/scala/net/kemitix/s3thorp/domain/S3MetaData.scala +++ b/domain/src/main/scala/net/kemitix/thorp/domain/S3MetaData.scala @@ -1,4 +1,4 @@ -package net.kemitix.s3thorp.domain +package net.kemitix.thorp.domain // For the LocalFile, the set of matching S3 objects with the same MD5Hash, and any S3 object with the same remote key final case class S3MetaData( diff --git a/domain/src/main/scala/net/kemitix/s3thorp/domain/S3ObjectsData.scala b/domain/src/main/scala/net/kemitix/thorp/domain/S3ObjectsData.scala similarity index 84% rename from domain/src/main/scala/net/kemitix/s3thorp/domain/S3ObjectsData.scala rename to domain/src/main/scala/net/kemitix/thorp/domain/S3ObjectsData.scala index 30a5723..88f5693 100644 --- a/domain/src/main/scala/net/kemitix/s3thorp/domain/S3ObjectsData.scala +++ b/domain/src/main/scala/net/kemitix/thorp/domain/S3ObjectsData.scala @@ -1,4 +1,4 @@ -package net.kemitix.s3thorp.domain +package net.kemitix.thorp.domain /** * A list of objects and their MD5 hash values. diff --git a/domain/src/main/scala/net/kemitix/s3thorp/domain/SizeTranslation.scala b/domain/src/main/scala/net/kemitix/thorp/domain/SizeTranslation.scala similarity index 92% rename from domain/src/main/scala/net/kemitix/s3thorp/domain/SizeTranslation.scala rename to domain/src/main/scala/net/kemitix/thorp/domain/SizeTranslation.scala index eabc885..ce84adb 100644 --- a/domain/src/main/scala/net/kemitix/s3thorp/domain/SizeTranslation.scala +++ b/domain/src/main/scala/net/kemitix/thorp/domain/SizeTranslation.scala @@ -1,4 +1,4 @@ -package net.kemitix.s3thorp.domain +package net.kemitix.thorp.domain object SizeTranslation { diff --git a/domain/src/main/scala/net/kemitix/s3thorp/domain/Terminal.scala b/domain/src/main/scala/net/kemitix/thorp/domain/Terminal.scala similarity index 94% rename from domain/src/main/scala/net/kemitix/s3thorp/domain/Terminal.scala rename to domain/src/main/scala/net/kemitix/thorp/domain/Terminal.scala index b4b8984..4188686 100644 --- a/domain/src/main/scala/net/kemitix/s3thorp/domain/Terminal.scala +++ b/domain/src/main/scala/net/kemitix/thorp/domain/Terminal.scala @@ -1,4 +1,4 @@ -package net.kemitix.s3thorp.domain +package net.kemitix.thorp.domain object Terminal { diff --git a/domain/src/test/scala/net/kemitix/s3thorp/domain/FiltersSuite.scala b/domain/src/test/scala/net/kemitix/thorp/domain/FiltersSuite.scala similarity index 97% rename from domain/src/test/scala/net/kemitix/s3thorp/domain/FiltersSuite.scala rename to domain/src/test/scala/net/kemitix/thorp/domain/FiltersSuite.scala index 264b43a..a196817 100644 --- a/domain/src/test/scala/net/kemitix/s3thorp/domain/FiltersSuite.scala +++ b/domain/src/test/scala/net/kemitix/thorp/domain/FiltersSuite.scala @@ -1,8 +1,8 @@ -package net.kemitix.s3thorp.domain +package net.kemitix.thorp.domain -import java.nio.file.{Path, Paths} +import java.nio.file.Paths -import net.kemitix.s3thorp.domain.Filter.{Exclude, Include} +import net.kemitix.thorp.domain.Filter.{Exclude, Include} import org.scalatest.FunSpec class FiltersSuite extends FunSpec { diff --git a/domain/src/test/scala/net/kemitix/s3thorp/domain/SizeTranslationTest.scala b/domain/src/test/scala/net/kemitix/thorp/domain/SizeTranslationTest.scala similarity index 96% rename from domain/src/test/scala/net/kemitix/s3thorp/domain/SizeTranslationTest.scala rename to domain/src/test/scala/net/kemitix/thorp/domain/SizeTranslationTest.scala index 48b3141..9f083c6 100644 --- a/domain/src/test/scala/net/kemitix/s3thorp/domain/SizeTranslationTest.scala +++ b/domain/src/test/scala/net/kemitix/thorp/domain/SizeTranslationTest.scala @@ -1,4 +1,4 @@ -package net.kemitix.s3thorp.domain +package net.kemitix.thorp.domain import org.scalatest.FunSpec