Java FileWriter Write saveMetadata(Map metadata, File file)

Here you can find the source of saveMetadata(Map metadata, File file)

Description

save Metadata

License

Open Source License

Declaration

public static void saveMetadata(Map<String, Object> metadata, File file) throws IOException 

Method Source Code


//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*/
    }
}

Related

  1. saveMap(Map map, String filePath)
  2. saveMap(String filename, Map map)
  3. saveMappingFile(File mappingFile, Map messageMap)
  4. saveMeasures(String appDirPath, String fileName, double[] measures)
  5. saveMetaClassToFile(File baseDir, String clazzDef, String metaPackageName, Class fromClazz)
  6. saveModelInFile(final String model, final String filename)
  7. savePValue2File(double[] pValue, String fileName)
  8. saveSeqAln(String[] alnSequences, String filePath)
  9. saveSimpleTextFile(String data, String path, String filename)