Skip to content

Commit

Permalink
Use Folder instead of Dir.
Browse files Browse the repository at this point in the history
  • Loading branch information
airxnoor committed May 28, 2024
1 parent 37116bb commit 375f729
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ internal class DelegateFileInputOutput(
) : PlatformFileInputOutput {
override val pathSeparator: Char = io.pathSeparator

override suspend fun mkdirs(path: String): Boolean = ensureDir {
override suspend fun mkdirs(path: String): Boolean = ensureFolder {
mkdirs(path)
}

override suspend fun size(path: String): Long = ensureDir {
override suspend fun size(path: String): Long = ensureFolder {
size(path)
}

override suspend fun write(
path: String,
position: Long,
contents: String,
) = ensureDir {
) = ensureFolder {
write(
path = path,
position = position,
Expand All @@ -52,36 +52,36 @@ internal class DelegateFileInputOutput(
override suspend fun append(
path: String,
contents: String,
) = ensureDir {
) = ensureFolder {
append(
path = path,
contents = contents,
)
}

override suspend fun ensure(path: String) = ensureDir {
override suspend fun ensure(path: String) = ensureFolder {
ensure(path)
}

override suspend fun delete(path: String) = ensureDir {
override suspend fun delete(path: String) = ensureFolder {
delete(path)
}

override suspend fun of(path: String): Collection<String> = ensureDir {
override suspend fun of(path: String): Collection<String> = ensureFolder {
of(path)
}

override suspend fun of(
path: String,
date: LogDate,
): Collection<String> = ensureDir {
): Collection<String> = ensureFolder {
of(
path = path,
date = date,
)
}

private suspend fun <T> ensureDir(
private suspend fun <T> ensureFolder(
action: suspend PlatformFileInputOutput.() -> T,
): T = with(io) {
val isDirectoryExists = mkdirs(folder)
Expand Down

0 comments on commit 375f729

Please sign in to comment.