Author: remy.maucherat(a)jboss.com
Date: 2008-07-22 09:17:32 -0400 (Tue, 22 Jul 2008)
New Revision: 723
Modified:
trunk/java/org/apache/catalina/core/StandardContext.java
trunk/webapps/docs/changelog.xml
Log:
- Add new catalina.work system property, and redo a bit the code to be more consistent.
Modified: trunk/java/org/apache/catalina/core/StandardContext.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardContext.java 2008-07-21 11:47:33 UTC (rev
722)
+++ trunk/java/org/apache/catalina/core/StandardContext.java 2008-07-22 13:17:32 UTC (rev
723)
@@ -1928,7 +1928,7 @@
}
File workDir = new File(getWorkDir());
if (!workDir.isAbsolute()) {
- File catalinaHome = engineBase();
+ File catalinaHome = workBase();
String catalinaHomePath = null;
try {
catalinaHomePath = catalinaHome.getCanonicalPath();
@@ -4769,6 +4769,16 @@
}
+ protected File workBase() {
+ String base = System.getProperty("catalina.work");
+ if( base == null ) {
+ return engineBase();
+ } else {
+ return (new File(base));
+ }
+ }
+
+
// -------------------------------------------------------- Private Methods
@@ -5092,16 +5102,7 @@
}
// Create this directory if necessary
- File dir = new File(workDir);
- if (!dir.isAbsolute()) {
- File catalinaHome = engineBase();
- String catalinaHomePath = null;
- try {
- catalinaHomePath = catalinaHome.getCanonicalPath();
- dir = new File(catalinaHomePath, workDir);
- } catch (IOException e) {
- }
- }
+ File dir = new File(getWorkPath());
dir.mkdirs();
// Set the appropriate servlet context attribute
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2008-07-21 11:47:33 UTC (rev 722)
+++ trunk/webapps/docs/changelog.xml 2008-07-22 13:17:32 UTC (rev 723)
@@ -55,6 +55,9 @@
<fix>
Prevent various possible character encoding hacks. (remm)
</fix>
+ <fix>
+ <jira>16</jira>: Add new catalina.work system property to use as the
optional base for work folders. (remm)
+ </fix>
</changelog>
</subsection>
<subsection name="Jasper">
Show replies by date