/** @since 0.9.24 */ public void saveConfig() throws IOException { DataHelper.storeProps(i2cpProps, _configFile); } }
private static Properties buildRouterProps(int id) { Properties props = getRouterProps(id); File f = new File(props.getProperty("router.configLocation")); if (!f.exists()) { f.getParentFile().mkdirs(); try { DataHelper.storeProps(props, f); } catch (IOException e) { e.printStackTrace(); } } return props; }
private static Properties buildClientProps(int id) { Properties rProps = getRouterProps(id); Properties props = getClientProps(); File f = new File(rProps.getProperty("router.clientConfigFile")); if (!f.exists()) { f.getParentFile().mkdirs(); try { DataHelper.storeProps(props, f); } catch (IOException e) { e.printStackTrace(); } } return props; }
public void saveConfig() { try { synchronized (_configLock) { DataHelper.storeProps(_config, _configFile); } } catch (IOException ioe) { addMessage(_t("Unable to save the config to {0}", _configFile.getAbsolutePath())); } }
protected void tearDown() throws IOException{ p.setProperty("logger.record.net.i2p.util.LogSettingsTest", origMinimumOnScreenLevel); p.setProperty("logger.minimumOnScreenLevel", origLogSettings); DataHelper.storeProps(p, f); System.gc(); }
/** * Save the current config options (returning true if save was * successful, false otherwise) * * Synchronized with file read in getConfig() */ public boolean saveConfig() { try { Properties ordered = new OrderedProperties(); synchronized(_configFileLock) { ordered.putAll(_config); DataHelper.storeProps(ordered, new File(_configFilename)); } } catch (IOException ioe) { // warning, _log will be null when called from constructor if (_log != null) _log.error("Error saving the config to " + _configFilename, ioe); else System.err.println("Error saving the config to " + _configFilename + ": " + ioe); return false; } return true; }
/** * Save the configuration of all known tunnels to the given file * */ public synchronized void saveConfig(String configFile) throws IOException { File cfgFile = new File(configFile); if (!cfgFile.isAbsolute()) cfgFile = new File(I2PAppContext.getGlobalContext().getConfigDir(), configFile); File parent = cfgFile.getParentFile(); if ( (parent != null) && (!parent.exists()) ) parent.mkdirs(); Properties map = new OrderedProperties(); _controllersLock.readLock().lock(); try { for (int i = 0; i < _controllers.size(); i++) { TunnelController controller = _controllers.get(i); Properties cur = controller.getConfig("tunnel." + i + "."); map.putAll(cur); } } finally { _controllersLock.readLock().unlock(); } DataHelper.storeProps(map, cfgFile); }
/** * @since 0.9.23 */ private void locked_saveTorrentStatus(byte[] ih, Properties config) { File conf = configFile(_configDir, ih); File subdir = conf.getParentFile(); if (!subdir.exists()) subdir.mkdirs(); try { DataHelper.storeProps(config, conf); if (_log.shouldInfo()) _log.info("Saved config to " + conf); } catch (IOException ioe) { _log.error("Unable to save the config to " + conf); } }
/** @return success */ public boolean saveConfig() { Properties props = createConfig(); try { DataHelper.storeProps(props, _locationFile); return true; } catch (IOException ioe) { getLog(LogManager.class).error("Error saving the config", ioe); return false; } }
/** * Store the current keys to disk in the location specified on creation. */ private void storeKeys() { synchronized (nameToPrivKeys) { File file = new File(persistFilename); // now in config dir but check base dir too... if (!file.exists() && !file.isAbsolute()) file = new File(I2PAppContext.getGlobalContext().getConfigDir(), persistFilename); try { Properties props = new OrderedProperties(); props.putAll(nameToPrivKeys); DataHelper.storeProps(props, file); if (_log.shouldInfo()) _log.info("Saved " + nameToPrivKeys.size() + " private keys to " + file); } catch (IOException ioe) { _log.error("Error writing out the SAM keys to " + file, ioe); } } }
subdir.mkdirs(); try { DataHelper.storeProps(props, cfg); } catch (IOException ioe) { _log.error("Error storing I2PSnark config " + cfg, ioe); newProps.putAll(oldProps); try { DataHelper.storeProps(newProps, newFile); } catch (IOException ioe) { _log.error("Error storing I2PSnark config " + newFile, ioe);
DataHelper.storeProps(opts, file);
p.setProperty("logger.minimumOnScreenLevel", Log.toLevelString(Log.DEBUG)); DataHelper.storeProps(p, f);
p.setProperty("logger.minimumOnScreenLevel", Log.toLevelString(Log.DEBUG)); DataHelper.storeProps(p, f); _context.logManager().rereadConfig();
p.setProperty("logger.minimumOnScreenLevel", Log.toLevelString(Log.DEBUG)); DataHelper.storeProps(p, f); _context.logManager().rereadConfig();
p.setProperty("logger.minimumOnScreenLevel", Log.toLevelString(Log.DEBUG)); DataHelper.storeProps(p, f); _context.logManager().rereadConfig();
p.setProperty("logger.minimumOnScreenLevel", Log.toLevelString(Log.DEBUG)); DataHelper.storeProps(p, f); _context.logManager().rereadConfig();
boolean shouldSave = SSLUtil.verifyKeyStore(opts); if (shouldSave) DataHelper.storeProps(opts, file); (new FwdRcvr(true, opts)).start();
/** * Saves the configuration to a file. */ public void save() { log.debug("Saving config file <" + configFile.getAbsolutePath() + ">"); try { DataHelper.storeProps(properties, new SecureFile(configFile.getAbsolutePath())); } catch (IOException e) { log.error("Cannot save configuration to file <" + configFile.getAbsolutePath() + ">", e); } }