FIXED - task 587: Correct initialization of the temporary directory - patch from the Wikier project

http://code.google.com/p/google-refine/issues/detail?id=587
https://bitbucket.org/wikier/google-refine/changeset/f3dbdb16a320#chg-main/src/com/google/refine/RefineServlet.java

git-svn-id: http://google-refine.googlecode.com/svn/trunk@2583 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
Tom Morris 2012-10-13 15:58:44 +00:00
parent 4d48741ce0
commit 068e0916a2

View File

@ -71,6 +71,7 @@ public class RefineServlet extends Butterfly {
static final long serialVersionUID = 2386057901503517403L;
static private final String JAVAX_SERVLET_CONTEXT_TEMPDIR = "javax.servlet.context.tempdir";
private File tempDir = null;
static private RefineServlet s_singleton;
static private File s_dataDir;
@ -221,11 +222,9 @@ public class RefineServlet extends Butterfly {
return path;
}
private File tempDir = null;
public File getTempDir() {
if (tempDir == null) {
File tempDir = (File) _config.getServletContext().getAttribute(JAVAX_SERVLET_CONTEXT_TEMPDIR);
tempDir = (File) _config.getServletContext().getAttribute(JAVAX_SERVLET_CONTEXT_TEMPDIR);
if (tempDir == null) {
throw new RuntimeException("This app server doesn't support temp directories");
}