本文整理了Java中org.nuxeo.common.Environment.<init>()
方法的一些代码示例,展示了Environment.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Environment.<init>()
方法的具体详情如下:
包路径:org.nuxeo.common.Environment
类名称:Environment
方法名:<init>
[英]Call to that constructor should be followed by a call to #init(). Depending on the available System properties, you may want to also call #loadProperties(Properties) or #setServerHome(File) methods before #init(); here is the recommended order:
Environment env = new Environment(home);
Environment.setDefault(env);
env.loadProperties(properties);
env.setServerHome(home);
env.init();
[中]对该构造函数的调用之后应该是对#init()的调用。根据可用的系统属性,您可能还希望在#init()之前调用#loadProperties(properties)或#setServerHome(File)方法;以下是推荐的订单:
Environment env = new Environment(home);
Environment.setDefault(env);
env.loadProperties(properties);
env.setServerHome(home);
env.init();
代码示例来源:origin: org.nuxeo.common/nuxeo-common
private static synchronized void tryInitEnvironment() {
String homeDir = System.getProperty(NUXEO_HOME);
if (homeDir != null) {
File home = new File(homeDir);
if (home.isDirectory()) {
DEFAULT = new Environment(home);
DEFAULT.init();
}
}
}
代码示例来源:origin: org.nuxeo.runtime/nuxeo-runtime-osgi
public NuxeoApp(File home, ClassLoader loader) {
this.loader = loader;
env = new Environment(home);
Environment.setDefault(env);
}
代码示例来源:origin: org.nuxeo.runtime/nuxeo-runtime-osgi
Environment env = new Environment(home);
env.setCommandLineArguments(args);
val = options.getOption("data");
return env;
} else {
return new Environment(new File("").getCanonicalFile());
代码示例来源:origin: org.nuxeo.runtime/nuxeo-runtime-osgi
env = new Environment(home);
代码示例来源: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;
}
内容来源于网络,如有侵权,请联系作者删除!