Add interface

This commit is contained in:
Kirill Grachev 2023-04-15 00:01:27 +03:00
parent f8e7f6567f
commit 6e9eb88934

View File

@ -0,0 +1,20 @@
package space.kscience.snark.storage
import java.nio.file.Path
public interface Directory : AutoCloseable {
public suspend fun get(filename: String): FileReader?
public suspend fun create(filename: String, ignoreIfExists: Boolean = false)
public suspend fun put(filename: String): FileWriter?
public suspend fun getSubdir(path: Path): Directory?
}
public interface FileReader : AutoCloseable {
public suspend fun readAll(): ByteArray
}
public interface FileWriter : AutoCloseable {
public suspend fun write(bytes: ByteArray)
}