Abd Alah
Abd Alah

Reputation: 7

Generate YAML file from string with SnakeYaml

Is it possible to parse with snakeyaml the following content (String)

environments.dev.url:http://dev.examle.com

environments.dev.name:Developer Setup

environments.prod.url:http://another.example.com

environments.prod.name:My Cool All

and obtain a YAML file

environments:
dev:
    url: http://dev.example.com
    name: Developer Setup
prod:
    url: http://another.example.com
    name: My Cool App

Upvotes: 0

Views: 1854

Answers (1)

efex09
efex09

Reputation: 419

SnakeYaml does not provide in built functionality to parse/convert a given .properties file into .yaml file.

You can try some third party libraries to convert your properties file into yaml file.

properties-to-yaml

props2yaml

Upvotes: 3

Related Questions