Java FileWriter Write saveMappingFile(File mappingFile, Map messageMap)

Here you can find the source of saveMappingFile(File mappingFile, Map messageMap)

Description

save Mapping File

License

Apache License

Declaration

private static final void saveMappingFile(File mappingFile, Map<String, Integer> messageMap) throws Exception 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.io.File;

import java.io.FileWriter;

import java.util.Map;

public class Main {
    private static final void saveMappingFile(File mappingFile, Map<String, Integer> messageMap) throws Exception {
        FileWriter fw = new FileWriter(mappingFile);
        for (String message : messageMap.keySet()) {
            Integer id = messageMap.get(message);
            fw.append(message).append("=").append(id.toString()).append("\n");
        }//ww w .java2  s  .co  m
        fw.close();
    }
}

Related

  1. saveList(String listName, Set list)
  2. saveListStringToFile(String filePath, List listString)
  3. saveListToFile(ArrayList list, String filePath)
  4. saveMap(Map map, String filePath)
  5. saveMap(String filename, Map map)
  6. saveMeasures(String appDirPath, String fileName, double[] measures)
  7. saveMetaClassToFile(File baseDir, String clazzDef, String metaPackageName, Class fromClazz)
  8. saveMetadata(Map metadata, File file)
  9. saveModelInFile(final String model, final String filename)