Commit 606207b4 authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Added map to yaml methods

parent 85708a4a
......@@ -14,7 +14,7 @@
*/
package nl.lumc.sasc.biopet.utils
import java.io.File
import java.io.{File, PrintWriter}
import java.util
import argonaut.Argonaut._
......@@ -153,6 +153,16 @@ object ConfigUtils extends Logging {
ConfigUtils.any2map(a)
}
lazy val yaml = new Yaml()
def mapToYaml(map: Map[String, Any]) = yaml.dump(yaml.load(ConfigUtils.mapToJson(map).nospaces))
def mapToYamlFile(map: Map[String, Any], outputFile: File) = {
val writer = new PrintWriter(outputFile)
writer.println(mapToYaml(map))
writer.close()
}
/** Convert json to native scala map/values */
def jsonToMap(json: Json): Map[String, Any] = {
var output: Map[String, Any] = Map()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment