*/
public void removeAlias(String alias);
+ /**
+ * Returns true if the Host will attempt to create directories for appBase and xmlBase
+ * unless they already exist.
+ * @return
+ */
+ public boolean getCreateDirs();
+ /**
+ * Set to true if the Host should attempt to create directories for xmlBase and appBase upon startup
+ * @param createDirs
+ */
+ public void setCreateDirs(boolean createDirs);
}
* Attribute value used to turn on/off XML namespace awarenes.
*/
private boolean xmlNamespaceAware = false;
-
+
+ /**
+ * Should we create directories upon startup for appBase and xmlBase
+ */
+ private boolean createDirs = true;
// ------------------------------------------------------------- Properties
}
+ /**
+ * Returns true if the Host will attempt to create directories for appBase and xmlBase
+ * unless they already exist.
+ * @return
+ */
+ public boolean getCreateDirs() {
+ return createDirs;
+ }
+
+ /**
+ * Set to true if the Host should attempt to create directories for xmlBase and appBase upon startup
+ * @param createDirs
+ */
+ public void setCreateDirs(boolean createDirs) {
+ this.createDirs = createDirs;
+ }
/**
* Return the value of the auto deploy flag. If true, it indicates that
return (sb.toString());
}
-
-
+
/**
* Start this host.
*
if (entry != null) {
istream = jar.getInputStream(entry);
- configBase().mkdirs();
-
ostream =
new BufferedOutputStream
(new FileOutputStream(xml), 1024);
digester.reset();
}
}
- configBase().mkdirs();
File xmlCopy = new File(configBase(), file + ".xml");
InputStream is = null;
OutputStream os = null;
} catch (Exception e) {
log.error(sm.getString("hostConfig.jmx.register", oname), e);
}
+
+ if (host.getCreateDirs()) {
+ File[] dirs = new File[] {appBase(),configBase()};
+ for (int i=0; i<dirs.length; i++) {
+ if ( (!dirs[i].exists()) && (!dirs[i].mkdirs())) {
+ log.error(sm.getString("hostConfig.createDirs",dirs[i]));
+ }
+ }
+ }
if (host.getDeployOnStartup())
deployApps();
userConfig.start=UserConfig: Processing START
userConfig.stop=UserConfig: Processing STOP
catalina.stopServer=No shutdown port configured. Shut down server through OS signal. Server not shut down.
+hostConfig.createDirs=Unable to create directory for deployment: {0}
Deployment</a> for more information on automatic recognition and
deployment of web applications to be deployed automatically.</p>
</attribute>
+
+ <attribute name="createDirs" required="false">
+ <p>If set to true, Tomcat will attempt to create the directories defined by the
+ attributes <code>appBase</code> and <code>xmlBase</code> during the startup phase.
+ The default value is <code>true</code>.
+ If set to true, and directory creation fails, an error message will be printed out but will not halt
+ the startup sequence.</p>
+ </attribute>
<attribute name="autoDeploy" required="false">
<p>This flag value indicates if new web applications, dropped in to