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

com.atlassian.maven.plugins.aws.it.StackInfoProvider.kt Maven / Gradle / Ivy

The newest version!
package com.atlassian.maven.plugins.aws.it

import com.google.gson.Gson
import org.apache.commons.io.FileUtils.readFileToString
import org.apache.commons.io.FileUtils.writeStringToFile
import java.io.File

class StackInfoProvider(
    private val workingDirectory: File
) {
    fun read(): StackInfo {
        val json = readFileToString(getFile())
        return Gson().fromJson(json, StackInfo::class.java)
    }

    private fun getFile() = File(workingDirectory, "stack.json")

    fun write(stackInfo: StackInfo) {
        val json = Gson().toJson(stackInfo)
        writeStringToFile(getFile(), json)
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy