Here you can find the source of saveMetadata(Map
public static void saveMetadata(Map<String, Object> metadata, File file) throws IOException
//package com.java2s; //License from project: Open Source License import com.google.gson.Gson; import java.io.*; import java.util.Map; public class Main { public static void saveMetadata(Map<String, Object> metadata, File file) throws IOException { BufferedWriter writer = new BufferedWriter(new FileWriter(file)); Gson gson = new Gson(); writer.write(gson.toJson(metadata)); writer.close();/*from w w w. ja v a2s.c o m*/ } }