Last active
April 23, 2021 22:17
-
-
Save ZieIony/11f51b84474bcdd086da7d8c7ee3a336 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const val PROPERTY_SLACK_TOKEN = "slack.token" | |
data class ToolsProperties( | |
val slackToken: String, | |
) | |
internal fun parseProperties(propertiesFileName: String): ToolsProperties? { | |
val properties = Properties() | |
val stream = FileInputStream(propertiesFileName) | |
properties.load(stream) | |
stream.close() | |
val slackToken = properties.getProperty(PROPERTY_SLACK_TOKEN, null) | |
if (slackToken == null) { | |
println("Property $PROPERTY_SLACK_TOKEN is missing") | |
return null | |
} | |
return ToolsProperties(slackToken) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment