From: remm Date: Sat, 9 Sep 2006 23:22:05 +0000 (+0000) Subject: - Always check the output folder when going in the compile method, to make sure it... X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=f612f04fcfcbb0122457d116dbdd72ddef3f8461;p=tomcat7.0 - Always check the output folder when going in the compile method, to make sure it exists. git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@441879 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/jasper/JspCompilationContext.java b/java/org/apache/jasper/JspCompilationContext.java index 957221a59..a72a72eda 100644 --- a/java/org/apache/jasper/JspCompilationContext.java +++ b/java/org/apache/jasper/JspCompilationContext.java @@ -606,6 +606,16 @@ public class JspCompilationContext { static Object outputDirLock = new Object(); + public void checkOutputDir() { + if (outputDir != null) { + if (!(new File(outputDir)).exists()) { + makeOutputDir(); + } + } else { + createOutputDir(); + } + } + protected boolean makeOutputDir() { synchronized(outputDirLock) { File outDirFile = new File(outputDir); diff --git a/java/org/apache/jasper/compiler/Compiler.java b/java/org/apache/jasper/compiler/Compiler.java index 048916fd4..0f4052440 100644 --- a/java/org/apache/jasper/compiler/Compiler.java +++ b/java/org/apache/jasper/compiler/Compiler.java @@ -130,6 +130,7 @@ public abstract class Compiler { pageInfo.setIncludeCoda(jspProperty.getIncludeCoda()); } + ctxt.checkOutputDir(); String javaFileName = ctxt.getServletJavaFileName(); ServletWriter writer = null;