Skip to content

Commit

Permalink
add Constants file for shared configuration values
Browse files Browse the repository at this point in the history
  • Loading branch information
abdlhay committed Oct 25, 2024
1 parent b8584a3 commit d75e47b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/main/kotlin/com/abmo/CliArguments.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.abmo

import com.abmo.Constant.DEFAULT_CONCURRENT_DOWNLOAD_LIMIT

class CliArguments(private val args: Array<String>) {

fun getHeaders(): Map<String, String>? {
Expand Down Expand Up @@ -49,7 +51,7 @@ class CliArguments(private val args: Array<String>) {
}
}

return 6
return DEFAULT_CONCURRENT_DOWNLOAD_LIMIT
}

}
7 changes: 7 additions & 0 deletions src/main/kotlin/com/abmo/Constant.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.abmo

object Constant {

const val DEFAULT_CONCURRENT_DOWNLOAD_LIMIT = 6

}
3 changes: 2 additions & 1 deletion src/main/kotlin/com/abmo/model/Config.kt
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package com.abmo.model

import com.abmo.Constant.DEFAULT_CONCURRENT_DOWNLOAD_LIMIT
import java.io.File

data class Config(
val url: String,
val resolution: String,
var outputFile: File?,
val header: Map<String, String>? = null,
val connections: Int = 6
val connections: Int = DEFAULT_CONCURRENT_DOWNLOAD_LIMIT
)

0 comments on commit d75e47b

Please sign in to comment.