From 634eb2d69df5af862d6c13a87295069f17dc22ae Mon Sep 17 00:00:00 2001 From: Kirill Grachev Date: Thu, 4 May 2023 21:11:56 +0300 Subject: [PATCH] SNRK-68: Implement s3 storage --- .../space/kscience/snark/storage/s3/S3Directory.kt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/snark-storage-driver/src/main/kotlin/space/kscience/snark/storage/s3/S3Directory.kt b/snark-storage-driver/src/main/kotlin/space/kscience/snark/storage/s3/S3Directory.kt index ed2c743..7dbb52b 100644 --- a/snark-storage-driver/src/main/kotlin/space/kscience/snark/storage/s3/S3Directory.kt +++ b/snark-storage-driver/src/main/kotlin/space/kscience/snark/storage/s3/S3Directory.kt @@ -15,6 +15,9 @@ internal class S3Directory( override suspend fun get(filename: String): FileReader = S3FileReader(client, bucketName, currentDir / filename) + override suspend fun get(filename: Path): FileReader = + S3FileReader(client, bucketName, currentDir / filename) + override suspend fun create(filename: String, ignoreIfExists: Boolean) { if (!ignoreIfExists) { TODO("could not check if file exists") @@ -24,6 +27,9 @@ internal class S3Directory( override suspend fun put(filename: String): FileWriter = S3FileWriter(client, bucketName, currentDir / filename) + override suspend fun put(filename: Path): FileWriter = + S3FileWriter(client, bucketName, currentDir / filename) + override suspend fun getSubdir(path: Path): S3Directory = S3Directory(client, bucketName, currentDir / path) @@ -34,6 +40,9 @@ internal class S3Directory( S3Directory(client, bucketName, currentDir / dirname) } + override val path: Path + get() = currentDir + override fun close() { } } \ No newline at end of file