org.nuxeo.common.Environment.setTemp()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(2.9k)|赞(0)|评价(0)|浏览(180)

本文整理了Java中org.nuxeo.common.Environment.setTemp()方法的一些代码示例,展示了Environment.setTemp()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Environment.setTemp()方法的具体详情如下:
包路径:org.nuxeo.common.Environment
类名称:Environment
方法名:setTemp

Environment.setTemp介绍

[英]Resolve the path against Environment#serverHome if not absolute.
[中]如果不是绝对路径,请针对环境#serverHome解析路径。

代码示例

代码示例来源:origin: org.nuxeo.common/nuxeo-common

  1. public File getTemp() {
  2. if (temp == null) {
  3. setTemp(properties.getProperty(NUXEO_TMP_DIR, DEFAULT_TMP_DIR));
  4. }
  5. return temp;
  6. }

代码示例来源:origin: org.nuxeo.common/nuxeo-common

  1. /**
  2. * Resolve the path against {@link Environment#serverHome} if not absolute.
  3. *
  4. * @since 8.1
  5. */
  6. public void setTemp(String temp) {
  7. setTemp(getServerHome().toPath().resolve(temp).toFile());
  8. }

代码示例来源:origin: org.nuxeo.common/nuxeo-common

  1. /**
  2. * Initialization with System properties to avoid issues due to home set with runtime home instead of server home.
  3. * If {@link #NUXEO_HOME} System property is not set, or if you want to set a custom server home, then you should
  4. * call {@link #setServerHome(File)} before.
  5. *
  6. * @since 5.4.1
  7. */
  8. public void init() {
  9. initServerHome();
  10. initRuntimeHome();
  11. String dataDir = System.getProperty(NUXEO_DATA_DIR);
  12. if (StringUtils.isNotEmpty(dataDir)) {
  13. setData(new File(dataDir));
  14. }
  15. String configDir = System.getProperty(NUXEO_CONFIG_DIR);
  16. if (StringUtils.isNotEmpty(configDir)) {
  17. setConfig(new File(configDir));
  18. }
  19. String logDir = System.getProperty(NUXEO_LOG_DIR);
  20. if (StringUtils.isNotEmpty(logDir)) {
  21. setLog(new File(logDir));
  22. }
  23. String tmpDir = System.getProperty(NUXEO_TMP_DIR);
  24. if (StringUtils.isNotEmpty(tmpDir)) {
  25. setTemp(new File(tmpDir));
  26. }
  27. String mpDir = System.getProperty(NUXEO_MP_DIR);
  28. setPath(NUXEO_MP_DIR, StringUtils.isNotEmpty(mpDir) ? mpDir : DEFAULT_MP_DIR, getServerHome());
  29. }

代码示例来源:origin: org.nuxeo.runtime/nuxeo-runtime-osgi

  1. env.setTemp(new File(val).getCanonicalFile());

代码示例来源:origin: org.nuxeo.runtime/nuxeo-runtime-osgi

  1. env.setTemp(new File(v));
  2. } else {
  3. sysprops.setProperty(Environment.NUXEO_TMP_DIR, env.getTemp().getAbsolutePath());

代码示例来源:origin: org.nuxeo.runtime/nuxeo-launcher-commons

  1. /**
  2. * @since 5.6
  3. * @return an {@link Environment} initialized with a few basics
  4. */
  5. public Environment getEnv() {
  6. /*
  7. * It could be useful to initialize DEFAULT env in {@link #setBasicConfiguration()}... For now, the generated
  8. * {@link Environment} is not static.
  9. */
  10. if (env == null) {
  11. env = new Environment(getRuntimeHome());
  12. File distribFile = new File(new File(nuxeoHome, TEMPLATES), "common/config/distribution.properties");
  13. if (distribFile.exists()) {
  14. try {
  15. env.loadProperties(loadTrimmedProperties(distribFile));
  16. } catch (IOException e) {
  17. log.error(e);
  18. }
  19. }
  20. env.loadProperties(userConfig);
  21. env.setServerHome(getNuxeoHome());
  22. env.init();
  23. env.setData(userConfig.getProperty(Environment.NUXEO_DATA_DIR, "data"));
  24. env.setLog(userConfig.getProperty(Environment.NUXEO_LOG_DIR, "logs"));
  25. env.setTemp(userConfig.getProperty(Environment.NUXEO_TMP_DIR, "tmp"));
  26. env.setPath(PARAM_MP_DIR, getDistributionMPDir(), env.getServerHome());
  27. env.setPath(Environment.NUXEO_MP_DIR, getPackagesDir(), env.getServerHome());
  28. }
  29. return env;
  30. }

相关文章