/** * @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; }
/** * Create needed directories. Check existence of old paths. If old paths have been found and they cannot be upgraded * automatically, then upgrading message is logged and error thrown. * * @throws ConfigurationException If a deprecated directory has been detected. * @since 5.4.2 * @see ServerConfigurator#verifyInstallation() */ public void verifyInstallation() throws ConfigurationException { checkJavaVersion(); ifNotExistsAndIsDirectoryThenCreate(getLogDir()); ifNotExistsAndIsDirectoryThenCreate(getPidDir()); ifNotExistsAndIsDirectoryThenCreate(getDataDir()); ifNotExistsAndIsDirectoryThenCreate(getTmpDir()); ifNotExistsAndIsDirectoryThenCreate(getPackagesDir()); checkAddressesAndPorts(); serverConfigurator.verifyInstallation(); backingServicesConfigurator.verifyInstallation(); }