本文整理了Java中org.nuxeo.common.Environment.loadProperties()
方法的一些代码示例,展示了Environment.loadProperties()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Environment.loadProperties()
方法的具体详情如下:
包路径:org.nuxeo.common.Environment
类名称:Environment
方法名:loadProperties
暂无
代码示例来源:origin: org.nuxeo.common/nuxeo-common
/**
* Call to that constructor should be followed by a call to {@link #init()}. Depending on the available System
* properties, you may want to also call {@link #setServerHome(File)} method before {@link #init()}; here is the
* recommended order:
*
* <pre>
* Environment env = new Environment(home, properties);
* Environment.setDefault(env);
* env.setServerHome(home);
* env.init();
* </pre>
*
* @param home Root path used for most defaults. It is recommended to make it match the server home rather than the
* runtime home.
* @param properties Source properties for initialization. It is used as an {@code Hashtable}: ie only the custom
* values are read, the properties default values are ignored if any.
* @see #init()
*/
public Environment(File home, Properties properties) {
this.home = home.getAbsoluteFile();
this.properties = new Properties();
if (properties != null) {
loadProperties(properties);
}
}
代码示例来源:origin: org.nuxeo.runtime/nuxeo-launcher-commons
/**
* @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;
}
内容来源于网络,如有侵权,请联系作者删除!