tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1162169 - in /tomcat/trunk: java/org/apache/catalina/core/ java/org/apache/catalina/loader/ java/org/apache/catalina/manager/ java/org/apache/catalina/manager/host/ java/org/apache/catalina/servlets/ java/org/apache/catalina/session/ java/...
Date Fri, 26 Aug 2011 17:08:18 GMT
Author: markt
Date: Fri Aug 26 17:08:17 2011
New Revision: 1162169

URL: http://svn.apache.org/viewvc?rev=1162169&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=51704
Make calls to File.mkdirs() more robust and handle errors in a few places where they were
ignored and should not have been.

Modified:
    tomcat/trunk/java/org/apache/catalina/core/StandardContext.java
    tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java
    tomcat/trunk/java/org/apache/catalina/loader/WebappLoader.java
    tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java
    tomcat/trunk/java/org/apache/catalina/manager/host/HostManagerServlet.java
    tomcat/trunk/java/org/apache/catalina/servlets/CGIServlet.java
    tomcat/trunk/java/org/apache/catalina/session/FileStore.java
    tomcat/trunk/java/org/apache/catalina/session/LocalStrings.properties
    tomcat/trunk/java/org/apache/catalina/startup/ExpandWar.java
    tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java
    tomcat/trunk/java/org/apache/catalina/startup/LocalStrings.properties
    tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java
    tomcat/trunk/java/org/apache/jasper/JspCompilationContext.java
    tomcat/trunk/java/org/apache/juli/FileHandler.java
    tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java
    tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java
    tomcat/trunk/test/org/apache/catalina/core/TestStandardContext.java
    tomcat/trunk/test/org/apache/catalina/servlets/TestDefaultServlet.java
    tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java

Modified: tomcat/trunk/java/org/apache/catalina/core/StandardContext.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardContext.java?rev=1162169&r1=1162168&r2=1162169&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/StandardContext.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardContext.java Fri Aug 26 17:08:17 2011
@@ -6057,7 +6057,7 @@ public class StandardContext extends Con
                         workDir, catalinaHomePath, getName()), e);
             }
         }
-        if (!dir.exists() && !dir.mkdirs()) {
+        if (!dir.mkdirs() && !dir.isDirectory()) {
             log.warn(sm.getString("standardContext.workCreateFail", dir,
                     getName()));
         }

Modified: tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java?rev=1162169&r1=1162168&r2=1162169&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java (original)
+++ tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java Fri Aug 26 17:08:17
2011
@@ -3011,8 +3011,11 @@ public class WebappClassLoader
                                             throw new IllegalArgumentException(
                                                     sm.getString("webappClassLoader.validationErrorJarPath",
                                                             jarEntry2.getName()), ioe);
-                                        }                                 
-                                        resourceFile.getParentFile().mkdirs();
+                                        }
+                                        File parentFile = resourceFile.getParentFile();
+                                        if (!parentFile.mkdirs() && !parentFile.exists())
{
+                                            // Ignore the error (like the IOExceptions below)
+                                        }
                                         FileOutputStream os = null;
                                         InputStream is = null;
                                         try {

Modified: tomcat/trunk/java/org/apache/catalina/loader/WebappLoader.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/loader/WebappLoader.java?rev=1162169&r1=1162168&r2=1162169&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/loader/WebappLoader.java (original)
+++ tomcat/trunk/java/org/apache/catalina/loader/WebappLoader.java Fri Aug 26 17:08:17 2011
@@ -883,10 +883,10 @@ public class WebappLoader extends Lifecy
             } else {
 
                 classRepository = new File(workDir, classesPath);
-                if (!classRepository.isDirectory()) {
-                    if (!classRepository.mkdirs())
-                        throw new IOException(
-                                sm.getString("webappLoader.mkdirFailure"));
+                if (!classRepository.mkdirs() &&
+                        !classRepository.isDirectory()) {
+                    throw new IOException(
+                            sm.getString("webappLoader.mkdirFailure"));
                 }
                 if (!copyDir(classes, classRepository)) {
                     throw new IOException(
@@ -935,10 +935,9 @@ public class WebappLoader extends Lifecy
             } else {
                 copyJars = true;
                 destDir = new File(workDir, libPath);
-                if (!destDir.isDirectory()) {
-                    if (!destDir.mkdirs())
-                        throw new IOException(
-                                sm.getString("webappLoader.mkdirFailure"));
+                if (!destDir.mkdirs() && !destDir.isDirectory()) {
+                    throw new IOException(
+                            sm.getString("webappLoader.mkdirFailure"));
                 }
             }
 

Modified: tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java?rev=1162169&r1=1162168&r2=1162169&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java (original)
+++ tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java Fri Aug 26 17:08:17
2011
@@ -636,7 +636,7 @@ public class ManagerServlet extends Http
         File deployedPath = deployed;
         if (tag != null) {
             deployedPath = new File(versioned, tag);
-            if (!deployedPath.isDirectory() && !deployedPath.mkdirs()) {
+            if (!deployedPath.mkdirs() && !deployedPath.isDirectory()) {
                 writer.println(smClient.getString("managerServlet.mkdirFail",
                         deployedPath));
                 return;
@@ -830,7 +830,7 @@ public class ManagerServlet extends Http
                 addServiced(name);
                 try {
                     if (config != null) {
-                        if (!configBase.isDirectory() && !configBase.mkdirs()) {
+                        if (!configBase.mkdirs() && !configBase.isDirectory()) {
                             writer.println(smClient.getString(
                                     "managerServlet.mkdirFail",configBase));
                             return;

Modified: tomcat/trunk/java/org/apache/catalina/manager/host/HostManagerServlet.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/manager/host/HostManagerServlet.java?rev=1162169&r1=1162168&r2=1162169&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/manager/host/HostManagerServlet.java (original)
+++ tomcat/trunk/java/org/apache/catalina/manager/host/HostManagerServlet.java Fri Aug 26
17:08:17 2011
@@ -381,13 +381,11 @@ public class HostManagerServlet
         } catch (IOException e) {
             appBaseFile = file;
         }
-        if (!appBaseFile.exists()) {
-            if (!appBaseFile.mkdirs()) {
-                writer.println(smClient.getString(
-                        "hostManagerServlet.appBaseCreateFail",
-                        appBaseFile.toString(), name));
-                return;
-            }
+        if (!appBaseFile.mkdirs() && !appBaseFile.isDirectory()) {
+            writer.println(smClient.getString(
+                    "hostManagerServlet.appBaseCreateFail",
+                    appBaseFile.toString(), name));
+            return;
         }
         
         // Create base for config files
@@ -704,10 +702,8 @@ public class HostManagerServlet
         if (installedHost != null) {
             configBase = new File(configBase, hostName);
         }
-        if (!configBase.exists()) {
-            if (!configBase.mkdirs()) {
-                return null;
-            }
+        if (!configBase.mkdirs() && !configBase.isDirectory()) {
+            return null;
         }
         return configBase;
     }

Modified: tomcat/trunk/java/org/apache/catalina/servlets/CGIServlet.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/servlets/CGIServlet.java?rev=1162169&r1=1162168&r2=1162169&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/servlets/CGIServlet.java (original)
+++ tomcat/trunk/java/org/apache/catalina/servlets/CGIServlet.java Fri Aug 26 17:08:17 2011
@@ -1149,9 +1149,11 @@ public final class CGIServlet extends Ht
             String dirPath = destPath.toString().substring(
                     0,destPath.toString().lastIndexOf("/"));
             File dir = new File(dirPath);
-            if (!dir.mkdirs() && debug >= 2) {
-                log("expandCGIScript: failed to create directories for '" +
-                        dir.getAbsolutePath() + "'");
+            if (!dir.mkdirs() && !dir.isDirectory()) {
+                if (debug >= 2) {
+                    log("expandCGIScript: failed to create directories for '" +
+                            dir.getAbsolutePath() + "'");
+                }
                 return;
             }
 

Modified: tomcat/trunk/java/org/apache/catalina/session/FileStore.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/session/FileStore.java?rev=1162169&r1=1162168&r2=1162169&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/session/FileStore.java (original)
+++ tomcat/trunk/java/org/apache/catalina/session/FileStore.java Fri Aug 26 17:08:17 2011
@@ -395,7 +395,7 @@ public final class FileStore extends Sto
      * session persistence directory, if any.  The directory will be
      * created if it does not already exist.
      */
-    private File directory() {
+    private File directory() throws IOException {
 
         if (this.directory == null) {
             return (null);
@@ -419,8 +419,14 @@ public final class FileStore extends Sto
             }
         }
         if (!file.exists() || !file.isDirectory()) {
-            file.delete();
-            file.mkdirs();
+            if (!file.delete() && file.exists()) {
+                throw new IOException(
+                        sm.getString("fileStore.deleteFailed", file));
+            }
+            if (!file.mkdirs() && !file.isDirectory()) {
+                throw new IOException(
+                        sm.getString("fileStore.createFailed", file));
+            }
         }
         this.directoryFile = file;
         return (file);
@@ -435,7 +441,7 @@ public final class FileStore extends Sto
      * @param id The ID of the Session to be retrieved. This is
      *    used in the file naming.
      */
-    private File file(String id) {
+    private File file(String id) throws IOException {
 
         if (this.directory == null) {
             return (null);

Modified: tomcat/trunk/java/org/apache/catalina/session/LocalStrings.properties
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/session/LocalStrings.properties?rev=1162169&r1=1162168&r2=1162169&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/session/LocalStrings.properties (original)
+++ tomcat/trunk/java/org/apache/catalina/session/LocalStrings.properties Fri Aug 26 17:08:17
2011
@@ -18,6 +18,8 @@ applicationSession.value.iae=null value
 fileStore.saving=Saving Session {0} to file {1}
 fileStore.loading=Loading Session {0} from file {1}
 fileStore.removing=Removing Session {0} at file {1}
+fileStore.deleteFailed=Unable to delete file [{0}] which is preventing the creation of the
session storage location
+fileStore.createFailed=Unable to create directory [{0}] for the storage of session data 
 JDBCStore.close=Exception closing database connection {0}
 JDBCStore.saving=Saving Session {0} to database {1}
 JDBCStore.loading=Loading Session {0} from database {1}

Modified: tomcat/trunk/java/org/apache/catalina/startup/ExpandWar.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/ExpandWar.java?rev=1162169&r1=1162168&r2=1162169&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/startup/ExpandWar.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/ExpandWar.java Fri Aug 26 17:08:17 2011
@@ -115,7 +115,10 @@ public class ExpandWar {
                 if (last >= 0) {
                     File parent = new File(docBase,
                                            name.substring(0, last));
-                    parent.mkdirs();
+                    if (!parent.mkdirs() && !parent.isDirectory()) {
+                        throw new IOException(
+                                sm.getString("expandWar.createFailed", parent));
+                    }
                 }
                 if (name.endsWith("/")) {
                     continue;

Modified: tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java?rev=1162169&r1=1162168&r2=1162169&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java Fri Aug 26 17:08:17 2011
@@ -1290,7 +1290,7 @@ public class HostConfig
         if (host.getCreateDirs()) {
             File[] dirs = new File[] {host.getAppBaseFile(),configBase()};
             for (int i=0; i<dirs.length; i++) {
-                if ( (!dirs[i].isDirectory()) && (!dirs[i].mkdirs())) {
+                if (!dirs[i].mkdirs() && !dirs[i].isDirectory()) {
                     log.error(sm.getString("hostConfig.createDirs",dirs[i]));
                 }
             }

Modified: tomcat/trunk/java/org/apache/catalina/startup/LocalStrings.properties
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/LocalStrings.properties?rev=1162169&r1=1162168&r2=1162169&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/startup/LocalStrings.properties (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/LocalStrings.properties Fri Aug 26 17:08:17
2011
@@ -70,6 +70,7 @@ engineConfig.cce=Lifecycle event data ob
 engineConfig.start=EngineConfig: Processing START
 engineConfig.stop=EngineConfig: Processing STOP
 expandWar.copy=Error copying {0} to {1}
+expandWar.createFailed=Unable to create the directory [{0}]
 expandWar.deleteFailed=[{0}] could not be completely deleted. The presence of the remaining
files may cause problems
 expandWar.illegalPath=The archive [{0}] is malformed and will be ignored: an entry contains
an illegal path [{1}] which was not expanded to [{2}] since that is outside of the defined
docBase [{3}]
 hostConfig.appBase=Application base [{1}] for host [{0}] does not exist or is not a directory.
deployOnStartUp and autoDeploy have been set to false to prevent deployment errors. Other
errors may still occur.

Modified: tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java?rev=1162169&r1=1162168&r2=1162169&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java (original)
+++ tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java Fri Aug 26 17:08:17 2011
@@ -1081,10 +1081,8 @@ public class AccessLogValve extends Valv
         File dir = new File(directory);
         if (!dir.isAbsolute())
             dir = new File(System.getProperty(Globals.CATALINA_BASE_PROP), directory);
-        if (!dir.exists()) {
-            if (!dir.mkdirs()) {
-                log.error(sm.getString("accessLogValve.openDirFail", dir));
-            }
+        if (!dir.mkdirs() && !dir.isDirectory()) {
+            log.error(sm.getString("accessLogValve.openDirFail", dir));
         }
 
         // Open the current log file
@@ -1097,10 +1095,8 @@ public class AccessLogValve extends Valv
             pathname = new File(dir.getAbsoluteFile(), prefix + suffix);
         }
         File parent = pathname.getParentFile();
-        if (!parent.exists()) {
-            if (!parent.mkdirs()) {
-                log.error(sm.getString("accessLogValve.openDirFail", parent));
-            }
+        if (!parent.mkdirs() && !parent.isDirectory()) {
+            log.error(sm.getString("accessLogValve.openDirFail", parent));
         }
 
         Charset charset = null;

Modified: tomcat/trunk/java/org/apache/jasper/JspCompilationContext.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/JspCompilationContext.java?rev=1162169&r1=1162168&r2=1162169&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/JspCompilationContext.java (original)
+++ tomcat/trunk/java/org/apache/jasper/JspCompilationContext.java Fri Aug 26 17:08:17 2011
@@ -709,7 +709,7 @@ public class JspCompilationContext {
     protected boolean makeOutputDir() {
         synchronized(outputDirLock) {
             File outDirFile = new File(outputDir);
-            return (outDirFile.exists() || outDirFile.mkdirs());
+            return (outDirFile.mkdirs() || outDirFile.isDirectory());
         }
     }
 

Modified: tomcat/trunk/java/org/apache/juli/FileHandler.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/juli/FileHandler.java?rev=1162169&r1=1162168&r2=1162169&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/juli/FileHandler.java (original)
+++ tomcat/trunk/java/org/apache/juli/FileHandler.java Fri Aug 26 17:08:17 2011
@@ -363,7 +363,7 @@ public class FileHandler
 
         // Create the directory if necessary
         File dir = new File(directory);
-        if (!dir.exists() && !dir.mkdirs()) {
+        if (!dir.mkdirs() && !dir.isDirectory()) {
             reportError("Unable to create [" + dir + "]", null,
                     ErrorManager.OPEN_FAILURE);
             writer = null;
@@ -376,13 +376,11 @@ public class FileHandler
             File pathname = new File(dir.getAbsoluteFile(), prefix
                     + (rotatable ? date : "") + suffix);
             File parent = pathname.getParentFile();
-            if (!parent.exists()) {
-                if (!parent.mkdirs()) {
-                    reportError("Unable to create [" + parent + "]", null,
-                            ErrorManager.OPEN_FAILURE);
-                    writer = null;
-                    return;
-                }
+            if (!parent.mkdirs() && !parent.isDirectory()) {
+                reportError("Unable to create [" + parent + "]", null,
+                        ErrorManager.OPEN_FAILURE);
+                writer = null;
+                return;
             }
             String encoding = getEncoding();
             FileOutputStream fos = new FileOutputStream(pathname, true);

Modified: tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java?rev=1162169&r1=1162168&r2=1162169&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java (original)
+++ tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java Fri Aug 26 17:08:17
2011
@@ -87,7 +87,7 @@ public class TestCoyoteAdapter extends T
         
         // Create the folder that will trigger the redirect
         File foo = new File(docBase, "foo");
-        if (!foo.exists() && !foo.mkdirs()) {
+        if (!foo.mkdirs() && !foo.isDirectory()) {
             fail("Unable to create foo directory in docBase");
         }
         

Modified: tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java?rev=1162169&r1=1162168&r2=1162169&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java (original)
+++ tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java Fri Aug 26 17:08:17
2011
@@ -411,7 +411,7 @@ public class TestAsyncContextImpl extend
         
         // Create the folder that will trigger the redirect
         File foo = new File(docBase, "async");
-        if (!foo.exists() && !foo.mkdirs()) {
+        if (!foo.mkdirs() && !foo.isDirectory()) {
             fail("Unable to create async directory in docBase");
         }
         

Modified: tomcat/trunk/test/org/apache/catalina/core/TestStandardContext.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/core/TestStandardContext.java?rev=1162169&r1=1162168&r2=1162169&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/core/TestStandardContext.java (original)
+++ tomcat/trunk/test/org/apache/catalina/core/TestStandardContext.java Fri Aug 26 17:08:17
2011
@@ -76,7 +76,7 @@ public class TestStandardContext extends
         Tomcat tomcat = getTomcatInstance();
         
         File docBase = new File(tomcat.getHost().getAppBaseFile(), "ROOT");
-        if (!docBase.exists() && !docBase.mkdirs()) {
+        if (!docBase.mkdirs() && !docBase.isDirectory()) {
             fail("Unable to create docBase");
         }
         

Modified: tomcat/trunk/test/org/apache/catalina/servlets/TestDefaultServlet.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/servlets/TestDefaultServlet.java?rev=1162169&r1=1162168&r2=1162169&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/servlets/TestDefaultServlet.java (original)
+++ tomcat/trunk/test/org/apache/catalina/servlets/TestDefaultServlet.java Fri Aug 26 17:08:17
2011
@@ -164,7 +164,7 @@ public class TestDefaultServlet extends 
     public void testCustomErrorPage() throws Exception {
         File appDir = new File(getTemporaryDirectory(), "MyApp");
         File webInf = new File(appDir, "WEB-INF");
-        if (!webInf.mkdirs()) {
+        if (!webInf.mkdirs() && !webInf.isDirectory()) {
             fail("Unable to create directory [" + webInf + "]");
         }
         Writer w = new OutputStreamWriter(new FileOutputStream(new File(appDir,
@@ -249,7 +249,7 @@ public class TestDefaultServlet extends 
     public void testCustomErrorPageMissing() throws Exception {
         File appDir = new File(getTemporaryDirectory(), "MyApp");
         File webInf = new File(appDir, "WEB-INF");
-        if (!webInf.mkdirs()) {
+        if (!webInf.mkdirs() && !webInf.isDirectory()) {
             fail("Unable to create directory [" + webInf + "]");
         }
         Writer w = new OutputStreamWriter(new FileOutputStream(new File(appDir,

Modified: tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java?rev=1162169&r1=1162168&r2=1162169&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java (original)
+++ tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java Fri Aug 26 17:08:17
2011
@@ -113,7 +113,7 @@ public abstract class TomcatBaseTest {
                 getBuildDirectory(), "conf/logging.properties").toString());
 
         tempDir = new File(System.getProperty("tomcat.test.temp", "output/tmp"));
-        if (!tempDir.exists() && !tempDir.mkdirs()) {
+        if (!tempDir.mkdirs() && !tempDir.isDirectory()) {
             fail("Unable to create temporary directory for test");
         }
         



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message