Java: YAML file handling -


i using snakeyaml handle yaml config file in java.

my yaml file structure this:

config.yml

user1: "john doe" user2: "jane smith" user3: "james doe" 

when do:

yaml yaml = new yaml(); map<string, string> data = new hashmap<string, string>(); data.put("kr", "test"); string output = yaml.dump(data); filewriter f = new filewriter("config.yml"); f.write(output); 

nothing written config file.

i want write key values config.yml file.

you don't seem closing filewriter. might need specify path well,

filewriter f = new filewriter("c:/config.yml"); // c:\\config.yml f.write(output); f.close(); 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -