@Override public void save(File config, Map<Integer, Command> commands) throws Exception { if (!config.exists()) { Log.e("XMLCommandParser", "Commands config doesn't exist!"); throw new XMLCommandParserException("Commands configuration file can not be found!"); } Serializer serializer = new Persister(); Commands commandsCommit = new Commands(); commandsCommit.setCommands(covertToList(commands)); serializer.write(commandsCommit, config); }