xyz.capybara.clamav.commands.VersionCommands.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of clamav-client Show documentation
Show all versions of clamav-client Show documentation
Java Client for the ClamAV antivirus service.
package xyz.capybara.clamav.commands
import xyz.capybara.clamav.InvalidResponseException
object VersionCommands : Command>() {
const private val COMMANDS_START_TAG = "| COMMANDS:"
override val commandString: String
get() = "VERSIONCOMMANDS"
override val format: Command.CommandFormat
get() = Command.CommandFormat.NEW_LINE
override fun parseResponse(responseString: String): Collection {
val commandsStartPos = responseString.indexOf(COMMANDS_START_TAG)
return when (commandsStartPos) {
-1 -> throw InvalidResponseException(responseString)
else -> responseString.substring(commandsStartPos + COMMANDS_START_TAG.length).split(" ".toRegex())
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy