SNRK-68: Add methods

This commit is contained in:
Kirill Grachev 2023-05-04 21:11:29 +03:00
parent 7599fd5ffd
commit 5b33419b37

View File

@ -3,13 +3,27 @@ package space.kscience.snark.storage
import java.nio.file.Path import java.nio.file.Path
public interface Directory : AutoCloseable { public interface Directory : AutoCloseable {
@Deprecated(
message = "Use Path, not String",
level = DeprecationLevel.WARNING,
)
public suspend fun get(filename: String): FileReader public suspend fun get(filename: String): FileReader
// get file from subtree
public suspend fun get(filename: Path): FileReader
public suspend fun create(filename: String, ignoreIfExists: Boolean = false) public suspend fun create(filename: String, ignoreIfExists: Boolean = false)
@Deprecated(
message = "Use Path, not String",
level = DeprecationLevel.WARNING,
)
public suspend fun put(filename: String): FileWriter public suspend fun put(filename: String): FileWriter
// put file to subtree
public suspend fun put(filename: Path): FileWriter
public suspend fun getSubdir(path: Path): Directory public suspend fun getSubdir(path: Path): Directory
public suspend fun createSubdir(dirname: String, ignoreIfExists: Boolean = false): Directory public suspend fun createSubdir(dirname: String, ignoreIfExists: Boolean = false): Directory
public val path: Path
} }
public interface FileReader : AutoCloseable { public interface FileReader : AutoCloseable {