/** * @since 5.6 * @param propsFile Properties file * @return new Properties containing trimmed keys and values read in {@code propsFile} */ public static Properties loadTrimmedProperties(File propsFile) throws IOException { Properties props = new Properties(); Charset charset = checkFileCharset(propsFile); if (charset == null) { throw new IOException("Can't identify input file charset for " + propsFile.getName()); } log.debug("Opening " + propsFile.getName() + " in " + charset.name()); try (InputStreamReader propsIS = new InputStreamReader(new FileInputStream(propsFile), charset)) { loadTrimmedProperties(props, propsIS); } return props; }
Properties subTemplateConf = loadTrimmedProperties(chosenTemplateConf); String subTemplatesList = replaceEnvironmentVariables( subTemplateConf.getProperty(PARAM_INCLUDED_TEMPLATES));
throws ConfigurationException, IOException { File templateConf = getTemplateConf(template); Properties templateProperties = loadTrimmedProperties(templateConf); Map<String, String> oldValues = new HashMap<>(); StringBuilder newContent = new StringBuilder();
String dbHost, String dbPort) throws IOException, DatabaseDriverException, SQLException { File databaseTemplateDir = new File(nuxeoHome, TEMPLATES + File.separator + databaseTemplate); Properties templateProperties = loadTrimmedProperties(new File(databaseTemplateDir, NUXEO_DEFAULT_CONF)); String classname, connectionUrl;
Properties templateProperties = ConfigurationGenerator.loadTrimmedProperties(new File(databaseTemplateDir, ConfigurationGenerator.NUXEO_DEFAULT_CONF)); String classname, connectionUrl;
/** * @since 5.6 * @return an {@link Environment} initialized with a few basics */ public Environment getEnv() { /* * It could be useful to initialize DEFAULT env in {@link #setBasicConfiguration()}... For now, the generated * {@link Environment} is not static. */ if (env == null) { env = new Environment(getRuntimeHome()); File distribFile = new File(new File(nuxeoHome, TEMPLATES), "common/config/distribution.properties"); if (distribFile.exists()) { try { env.loadProperties(loadTrimmedProperties(distribFile)); } catch (IOException e) { log.error(e); } } env.loadProperties(userConfig); env.setServerHome(getNuxeoHome()); env.init(); env.setData(userConfig.getProperty(Environment.NUXEO_DATA_DIR, "data")); env.setLog(userConfig.getProperty(Environment.NUXEO_LOG_DIR, "logs")); env.setTemp(userConfig.getProperty(Environment.NUXEO_TMP_DIR, "tmp")); env.setPath(PARAM_MP_DIR, getDistributionMPDir(), env.getServerHome()); env.setPath(Environment.NUXEO_MP_DIR, getPackagesDir(), env.getServerHome()); } return env; }
private void setBasicConfiguration(boolean save) throws ConfigurationException { try { defaultConfig = loadTrimmedProperties(nuxeoDefaultConf); userConfig.putAll(loadTrimmedProperties(nuxeoConf)); onceGeneration = "once".equals(userConfig.getProperty(PARAM_FORCE_GENERATION)); forceGeneration = onceGeneration