code: public static void saveContentMap(Map<String, String> map, File file) throws IOException {
  
      FileWriter out = new FileWriter(file);
      for (String key : map.keySet()) {
        if (map.get(key) != null) {
          out.write(key.replace(":", "#escapedtwodots#") + ":"
              + map.get(key).replace(":", "#escapedtwodots#") + "\r\n");
        }
      }
      out.close();
    }
docs: Save map to file
  @param map Map to save
  @param file File to save
  @throws IOException I/O error