You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
815 B
Kotlin
22 lines
815 B
Kotlin
package me.eater.hefbrug.access
|
|
|
|
import me.eater.hefbrug.logging.Logging
|
|
import me.eater.hefbrug.utils.escape
|
|
import org.apache.logging.log4j.Level
|
|
|
|
class Wrapper(private val parent: AccessSkeleton, val rw: Boolean = true) : AccessSkeleton by parent, Logging {
|
|
|
|
|
|
override suspend fun execute(
|
|
vararg command: String,
|
|
environment: Map<String, String>,
|
|
workingDirectory: String?
|
|
): ExecutionOutput {
|
|
log(if (rw) Level.INFO else Level.DEBUG, "Executing [${id()}][${if (rw) "rw" else "ro"}] [${command.joinToString(" ") { it.escape() }}]")
|
|
return parent.execute(*command, environment = environment, workingDirectory = workingDirectory)
|
|
}
|
|
|
|
override suspend fun exists(fileName: String, type: FileType): Boolean {
|
|
return super.exists(fileName, type)
|
|
}
|
|
} |