// Copy storm files back to stormdist dir from the tmp dir
stormDistDir = StormConfig.masterStormdistRoot(conf, topologyId);
stormTmpDir = StormConfig.masterStormTmpRoot(conf, topologyname);
FileUtils.copyDirectory(new File(stormTmpDir), new File(stormDistDir));
StormTopology topology = StormConfig.read_nimbus_topology_code(conf, topologyId);
if (jsonConf != null) {
// Update stormconf.ser
Map serConf = StormConfig.read_nimbusTmp_topology_conf(conf, topologyname);
Map<Object, Object> newSerConf = (Map<Object, Object>) JStormUtils
.from_json(jsonConf);
serConf.putAll(newSerConf);
Map<Object, Object> stormConf = NimbusUtils.normalizeConf(conf, serConf,
topology);
File stormConfFile = new File(StormConfig.stormconf_path(stormDistDir));
if (stormConfFile.exists()) stormConfFile.delete();
FileUtils.writeByteArrayToFile(stormConfFile, Utils.serialize(stormConf));
// Update stormcode.ser
StormTopology normalizedTopology = NimbusUtils.normalizeTopology(
stormConf, topology, true);
File stormCodeFile = new File(StormConfig.stormcode_path(stormDistDir));
if (stormCodeFile.exists()) stormCodeFile.delete();
FileUtils.writeByteArrayToFile(stormCodeFile, Utils.serialize(normalizedTopology));
}