costin 01/09/19 20:42:09
Modified: src/share/org/apache/tomcat/modules/config WorkDirSetup.java
Log:
Fix for 3581 reported by [EMAIL PROTECTED] An exception was thrown
because the work dir was cleaned up after it was created.
I have doubts about supporting the 'clean workspace' option of WorkDirSetup ( we
have it for backward compat with tomcat3.0 ), since it force recompilation for
all jsp pages, and removes any way of storing data in the only place the sandbox
allows
servlets to write. ( it is disabled by default, but it seems people might use it, so
it may be usefull regardless of my opinion :-) )
Revision Changes Path
1.9 +5 -4
jakarta-tomcat/src/share/org/apache/tomcat/modules/config/WorkDirSetup.java
Index: WorkDirSetup.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/config/WorkDirSetup.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- WorkDirSetup.java 2001/08/26 01:52:57 1.8
+++ WorkDirSetup.java 2001/09/20 03:42:09 1.9
@@ -135,16 +135,17 @@
if( ctx.getWorkDir() == null)
initWorkDir(ctx);
+ // #3581 - remove old dir _before_ creating the new one
+ if ( cleanWorkDir ) {
+ FileUtil.clearDir(ctx.getWorkDir() );
+ }
+
// Make sure the workdir exists
if (! ctx.getWorkDir().exists()) {
log("Creating work dir " + ctx.getWorkDir());
ctx.getWorkDir().mkdirs();
}
- //
- if ( cleanWorkDir ) {
- FileUtil.clearDir(ctx.getWorkDir() );
- }
}
public void contextShutdown( Context ctx ) {