本文整理了Java中org.nuxeo.common.Environment.getTemp()
方法的一些代码示例,展示了Environment.getTemp()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Environment.getTemp()
方法的具体详情如下:
包路径:org.nuxeo.common.Environment
类名称:Environment
方法名:getTemp
暂无
代码示例来源:origin: org.nuxeo.runtime/nuxeo-runtime-test
public File resolveAndCreate(File aFile) {
File temp = Environment.getDefault().getTemp();
File actual = temp.toPath().resolve(aFile.toPath()).toFile();
try {
actual.createNewFile();
} catch (IOException e) {
throw new RuntimeException("Cannot create temp file " + actual);
}
created.add(actual);
return actual;
}
}
代码示例来源:origin: org.nuxeo.elasticsearch/nuxeo-elasticsearch-core
/**
* @since 8.4
*/
public String getHomePath() {
if (homePath == null) {
// Since ES 2.X we need to set a home path for embedded node, but it is not used by the bundle
File dir = new File(Environment.getDefault().getTemp(), "elasticsearch");
homePath = dir.getPath();
}
return homePath;
}
代码示例来源:origin: org.nuxeo.template.rendering/nuxeo-template-rendering-core
protected File getWorkingDir() {
File workingDir = new File(Environment.getDefault().getTemp(), "NXTemplateProcessor"
+ System.currentTimeMillis());
if (workingDir.exists()) {
FileUtils.deleteQuietly(workingDir);
}
workingDir.mkdirs();
Framework.trackFile(workingDir, workingDir);
return workingDir;
}
代码示例来源:origin: org.nuxeo.runtime/nuxeo-runtime-test
@Override
public void beforeMethodRun(FeaturesRunner runner, FrameworkMethod method, Object test) throws Exception {
File temp = Environment.getDefault().getTemp();
tempPath = temp.toPath();
tracked.clear();
created.clear();
listener.install();
}
代码示例来源:origin: org.nuxeo.ecm.core/nuxeo-core-schema
public SchemaManagerImpl() {
recomputeCallbacks = new ArrayList<>();
schemaDir = new File(Environment.getDefault().getTemp(), SCHEMAS_DIR_NAME);
schemaDir.mkdirs();
clearSchemaDir();
registerBuiltinTypes();
}
代码示例来源:origin: org.nuxeo.runtime/nuxeo-runtime-osgi
/**
* @since 5.5
* @return Environment summary
*/
protected static StringBuilder getStartMessage() {
String newline = System.getProperty("line.separator");
Environment env = Environment.getDefault();
String hr = "======================================================================";
StringBuilder msg = new StringBuilder(newline);
msg.append(hr).append(newline);
msg.append("= Starting Nuxeo Framework").append(newline);
msg.append(hr).append(newline);
msg.append(" * Server home = ").append(env.getServerHome()).append(newline);
msg.append(" * Runtime home = ").append(env.getRuntimeHome()).append(newline);
msg.append(" * Data Directory = ").append(env.getData()).append(newline);
msg.append(" * Log Directory = ").append(env.getLog()).append(newline);
msg.append(" * Configuration Directory = ").append(env.getConfig()).append(newline);
msg.append(" * Temp Directory = ").append(env.getTemp()).append(newline);
msg.append(hr);
return msg;
}
}
代码示例来源:origin: org.nuxeo.ecm.platform/nuxeo-platform-web-common
/**
* @deprecated since 9.1. It was defined for ClipboardActionsBean but it seems not to be used anymore.
*/
@Deprecated
protected void handleDownloadTemporaryZip(HttpServletRequest req, HttpServletResponse resp, String filePath)
throws IOException {
String[] pathParts = filePath.split("/");
String tmpFileName = pathParts[0];
File tmpZip = new File(Environment.getDefault().getTemp(), tmpFileName);
try {
Blob zipBlob = Blobs.createBlob(tmpZip);
DownloadService downloadService = Framework.getService(DownloadService.class);
downloadService.downloadBlob(req, resp, null, null, zipBlob, "clipboard.zip", "clipboardZip");
} finally {
tmpZip.delete();
}
}
代码示例来源:origin: org.nuxeo.runtime/nuxeo-runtime-test
@Override
public void start(BundleContext context) {
log.info("Starting Runtime Activator");
// create the runtime
runtime = new OSGiRuntimeService(context);
String tempDir = Environment.getDefault().getTemp().getAbsolutePath();
System.setProperty("java.io.tmpdir", tempDir);
System.setProperty(Environment.NUXEO_TMP_DIR, tempDir);
// load main config file if any
URL config = context.getBundle().getResource("/OSGI-INF/nuxeo.properties");
if (config != null) {
System.setProperty(OSGiRuntimeService.PROP_CONFIG_DIR, config.toExternalForm());
}
initialize(runtime);
// start it
Framework.initialize(runtime);
// register bundle component loader
componentLoader = new OSGiComponentLoader(runtime);
// TODO register osgi services
}
代码示例来源:origin: org.nuxeo.runtime/nuxeo-runtime-osgi
env.getData().mkdirs();
env.getLog().mkdirs();
env.getTemp().mkdirs();
return env;
} else {
代码示例来源:origin: org.nuxeo.runtime/nuxeo-runtime-osgi
env.setTemp(new File(v));
} else {
sysprops.setProperty(Environment.NUXEO_TMP_DIR, env.getTemp().getAbsolutePath());
内容来源于网络,如有侵权,请联系作者删除!