SNRK-67: Make implementation private

This commit is contained in:
Kirill Grachev 2023-04-24 00:37:14 +03:00
parent 8069ea2f0b
commit b543735628

View File

@ -10,14 +10,14 @@ public fun localStorage(rootPath: Path): Directory {
return LocalDirectory(rootPath, ".") return LocalDirectory(rootPath, ".")
} }
public class LocalFile(private val path: String) : FileReader, FileWriter { private class LocalFile(private val path: String) : FileReader, FileWriter {
override fun close() {} override fun close() {}
override suspend fun readAll(): ByteArray = File(this.path).readBytes() override suspend fun readAll(): ByteArray = File(this.path).readBytes()
override suspend fun write(bytes: ByteArray) = File(this.path).writeBytes(bytes) override suspend fun write(bytes: ByteArray) = File(this.path).writeBytes(bytes)
} }
public class LocalDirectory(private val root: Path, path: String) : Directory { private class LocalDirectory(private val root: Path, path: String) : Directory {
private val current = "$root/$path" private val current = "$root/$path"
private fun child(child: String): String = "$current/$child" private fun child(child: String): String = "$current/$child"