Optimizer

sealed class Optimizer(logger: Logger)(source)

Inheritors

Constructors

Link copied to clipboard
protected constructor(logger: Logger)

Types

Link copied to clipboard

Optimize AVG files by using an external CLI tool called Avocado. Similar to SVGO, but for Android Vector Graphics files.

Link copied to clipboard
class Factory(logger: Logger, fileManager: FileManager)
Link copied to clipboard
class SvgoOptimizer(logger: Logger, fileManager: FileManager) : Optimizer

Optimize SVG files by using an external CLI tool called SVGO.

Properties

Link copied to clipboard
abstract val allowedExtension: String

Represents the extension of file types that the optimizer can process.

Link copied to clipboard
abstract val command: String

Represents the external command that will be used for optimization.

Link copied to clipboard
protected open val versionFlag: String

Represents the version flag argument used to verify the installation of the optimizers' software dependency by running the command with this flag.

Functions

Link copied to clipboard
abstract fun run(file: Path): Path

Runs the optimization process on the given file, and returns a new Path of the optimized file.

Link copied to clipboard
protected fun runOptimization(errorCode: ErrorCode, vararg args: String)

Execute the optimization process by using external software dependency.

Link copied to clipboard

Checks if the required software for this optimizer is installed on the current system.