tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup HostConfig.java
Date Sun, 15 Jun 2003 07:41:56 GMT
remm        2003/06/15 00:41:56

  Modified:    catalina/src/share/org/apache/catalina/startup
                        HostConfig.java
  Log:
  - Better handling for webapps which have been undeployed through the
    manager.
  
  Revision  Changes    Path
  1.13      +11 -7     jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/HostConfig.java
  
  Index: HostConfig.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/HostConfig.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- HostConfig.java	10 Jun 2003 20:15:35 -0000	1.12
  +++ HostConfig.java	15 Jun 2003 07:41:56 -0000	1.13
  @@ -706,10 +706,11 @@
                   if (files[i].endsWith(".war")) {
                       File dir = new File(appBase, files[i]);
                       Long lastModified = (Long) warLastModified.get(files[i]);
  +                    long dirLastModified = dir.lastModified();
                       if (lastModified == null) {
                           warLastModified.put
                               (files[i], new Long(dir.lastModified()));
  -                    } else if (dir.lastModified() > lastModified.longValue()) {
  +                    } else if (dirLastModified > lastModified.longValue()) {
                           // The WAR has been modified: redeploy
                           String expandedDir = files[i];
                           int period = expandedDir.lastIndexOf(".");
  @@ -719,10 +720,13 @@
                           String contextPath = "/" + expandedDir;
                           if (contextPath.equals("/ROOT"))
                               contextPath = "";
  -                        if (dir.lastModified() > expanded.lastModified()) {
  +                        if (dirLastModified > expanded.lastModified()) {
                               try {
  -                                ((Deployer) host).remove(contextPath, true);
                                   deployed.remove(files[i]);
  +                                if (host.findChild(contextPath) != null) {
  +                                    ((Deployer) host).remove(contextPath, 
  +                                                             true);
  +                                }
                               } catch (Throwable t) {
                                   log.error(sm.getString("hostConfig.undeployJar.error",
                                                          files[i]), t);
  
  
  

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


Mime
View raw message