tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Johnson <scott...@us.ibm.com>
Subject Re: [TC6] makeOutputDir() revision breaks Jasper
Date Sat, 09 Sep 2006 22:18:53 GMT
Or, a better fix:

    protected boolean makeOutputDir() {
        synchronized(outputDirLock) {
            File outDirFile = new File(outputDir);
            return (outDirFile.exists() || outDirFile.mkdirs());
        }
    }







Scott Johnson/Raleigh/IBM@IBMUS 
09/08/2006 01:20 PM
Please respond to
"Tomcat Developers List" <dev@tomcat.apache.org>


To
Tomcat Developers List <dev@tomcat.apache.org>
cc

Subject
[TC6] makeOutputDir() revision breaks Jasper






Revision 441109 to JspCompilationContext.java results in makeOutputDir() 
returning false even if the desired outputDir exists.  This is because 
File.mkdirs() returns true  "if and only if the directory was created". If 

the directory already exists, makeOutputDir() is returning false, 
resulting in an IllegalStateException being thrown.

Possible fix that fits in with other recent revisions to 
JspCompilationContext.java:

    protected boolean makeOutputDir() {
        synchronized(outputDirLock) {
            File outDirFile = new File(outputDir);
            if (!outDirFile.mkdirs() && !outDirFile.exists())
                return false;
            else
                return true;
        }
    }




Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message