All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.sentry.android.gradle.util.PropertiesUtil.kt Maven / Gradle / Ivy

There is a newer version: 4.11.0
Show newest version
package io.sentry.android.gradle.util

import java.io.File
import java.util.Properties

class PropertiesUtil {
    companion object {
        fun load(file: File): Properties {
            check(file.exists()) {
                "${file.name} properties file is missing"
            }

            return Properties().also { properties ->
                file.inputStream().use {
                    properties.load(it)
                }
            }
        }

        fun loadMaybe(file: File): Properties? {
            if (!file.exists()) {
                return null
            }

            return load(file)
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy