Here you can find the source of saveMappingFile(File mappingFile, Map
private static final void saveMappingFile(File mappingFile, Map<String, Integer> messageMap) throws Exception
//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(); } }