Follow up to http://svn.apache.org/viewvc?rev=1086969&view=rev
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 31 Mar 2011 12:37:10 +0000 (12:37 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 31 Mar 2011 12:37:10 +0000 (12:37 +0000)
Ensure that when copyXML=false:
- removing context.xml triggers a redploy but does not remove any other files
- removing context.xml triggers a redploy and the context.xml is re-copied from the WAR

This should be consistent with behaviour when copyXML=true

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1087281 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/startup/HostConfig.java

index fd6b181..87beb13 100644 (file)
@@ -795,7 +795,7 @@ public class HostConfig
                 if (entry != null) {
                     xmlInWar = true;
                 }
-                if (copyXML && xmlInWar) {
+                if ((copyXML || unpackWARs) && xmlInWar) {
                     istream = jar.getInputStream(entry);
                     
                     ostream =
@@ -915,7 +915,7 @@ public class HostConfig
             deployedApp.redeployResources.put
                 (war.getAbsolutePath(), Long.valueOf(war.lastModified()));
 
-            if (deployXML && xml.exists()) {
+            if (deployXML && xml.exists() && copyXML) {
                 deployedApp.redeployResources.put(xml.getAbsolutePath(),
                         Long.valueOf(xml.lastModified()));
             }
@@ -938,7 +938,7 @@ public class HostConfig
                         Long.valueOf(docBase.lastModified()));
                 addWatchedResources(deployedApp, docBase.getAbsolutePath(),
                         context);
-                if (deployXML && !copyXML && xmlInWar) {
+                if (deployXML && !copyXML && (xmlInWar || xml.exists())) {
                     deployedApp.redeployResources.put(xml.getAbsolutePath(),
                             Long.valueOf(xml.lastModified()));
                 }