From 9ae78f962218eebeb900500199e8f5f8221d0095 Mon Sep 17 00:00:00 2001 From: Michel Palourdio Date: Tue, 7 May 2024 19:01:40 +0200 Subject: [PATCH] review --- pom.xml | 8 -------- .../mpalourdio/projects/flhacker/FlhackerApplication.kt | 4 ++-- .../projects/flhacker/utils/AudiofileHandler.kt | 2 +- .../com/mpalourdio/projects/flhacker/utils/CliHandler.kt | 2 +- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/pom.xml b/pom.xml index aa322ab..cc3c473 100644 --- a/pom.xml +++ b/pom.xml @@ -73,14 +73,6 @@ org.springframework.boot spring-boot-maven-plugin - - - repackage - - true - - - org.jetbrains.kotlin diff --git a/src/main/kotlin/com/mpalourdio/projects/flhacker/FlhackerApplication.kt b/src/main/kotlin/com/mpalourdio/projects/flhacker/FlhackerApplication.kt index 258acff..8052714 100644 --- a/src/main/kotlin/com/mpalourdio/projects/flhacker/FlhackerApplication.kt +++ b/src/main/kotlin/com/mpalourdio/projects/flhacker/FlhackerApplication.kt @@ -23,9 +23,9 @@ class FlhackerApplication { fun run(): CommandLineRunner { return CommandLineRunner { args -> AudiofileHandler.setUp() - val cmd: CommandLine? = CliHandler.run(args) + val cmd: CommandLine = CliHandler.run(args) try { - AudiofileHandler.extractResizeSaveArtwork(cmd?.getOptionValue(CliHandler.FILE_CMD_LONG_OPTION)) + AudiofileHandler.extractResizeSaveArtwork(cmd.getOptionValue(CliHandler.FILE_CMD_LONG_OPTION)) AudiofileHandler.generateAsciiArt() } finally { AudiofileHandler.tearDown() diff --git a/src/main/kotlin/com/mpalourdio/projects/flhacker/utils/AudiofileHandler.kt b/src/main/kotlin/com/mpalourdio/projects/flhacker/utils/AudiofileHandler.kt index d799b5b..a706775 100644 --- a/src/main/kotlin/com/mpalourdio/projects/flhacker/utils/AudiofileHandler.kt +++ b/src/main/kotlin/com/mpalourdio/projects/flhacker/utils/AudiofileHandler.kt @@ -48,7 +48,7 @@ object AudiofileHandler { ReadOnlyFileException::class, IOException::class ) - fun extractResizeSaveArtwork(audioFilePath: String?) { + fun extractResizeSaveArtwork(audioFilePath: String) { val audioFile = File(audioFilePath) val extractedArtwork = AudioFileIO.read(audioFile) .tag diff --git a/src/main/kotlin/com/mpalourdio/projects/flhacker/utils/CliHandler.kt b/src/main/kotlin/com/mpalourdio/projects/flhacker/utils/CliHandler.kt index b4869d2..4985b11 100644 --- a/src/main/kotlin/com/mpalourdio/projects/flhacker/utils/CliHandler.kt +++ b/src/main/kotlin/com/mpalourdio/projects/flhacker/utils/CliHandler.kt @@ -14,7 +14,7 @@ import kotlin.system.exitProcess object CliHandler { const val FILE_CMD_LONG_OPTION: String = "file" - fun run(args: Array?): CommandLine? { + fun run(args: Array): CommandLine { val options = Options() val input = Option("f", FILE_CMD_LONG_OPTION, true, "audio file path which contains the artwork to print")