remm        2003/06/23 13:33:27

  Modified:    catalina/src/share/org/apache/catalina/core
                        StandardHostDeployer.java
  Log:
  - Code cleanup.
  - Remove XML descriptor on undeploy (bug 19607).
  
  Revision  Changes    Path
  1.12      +16 -9     
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardHostDeployer.java
  
  Index: StandardHostDeployer.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardHostDeployer.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- StandardHostDeployer.java 21 Jun 2003 20:00:23 -0000      1.11
  +++ StandardHostDeployer.java 23 Jun 2003 20:33:27 -0000      1.12
  @@ -128,6 +128,7 @@
        */
       private ContextRuleSet contextRuleSet = null;
   
  +
        /**
        * The <code>Digester</code> instance to use for deploying web applications
        * to this <code>Host</code>.  <strong>WARNING</strong> - Usage of this
  @@ -136,6 +137,7 @@
        */
       private Digester digester = null;
   
  +
       /**
        * The <code>StandardHost</code> instance we are associated with.
        */
  @@ -411,7 +413,7 @@
               // save context info into configFile
               Engine engine = (Engine)host.getParent();
               StandardServer server = (StandardServer) 
engine.getService().getServer();
  -            server.storeContext(context);
  +            //server.storeContext(context);
           } catch (Exception e) {
               log.error(sm.getString("standardHost.installError", contextPath),
                         e);
  @@ -629,8 +631,10 @@
           host.log(sm.getString("standardHost.removing", contextPath));
           try {
               // Get the work directory for the Context
  -            File workDir = (File)
  -                context.getServletContext().getAttribute(Globals.WORK_DIR_ATTR);
  +            File workDir = 
  +                (File) context.getServletContext().getAttribute
  +                (Globals.WORK_DIR_ATTR);
  +            String configFile = context.getConfigFile();
               host.removeChild(context);
   
               if (undeploy) {
  @@ -645,7 +649,8 @@
                                          host.getAppBase());
                   File contextFile = new File(context.getDocBase());
                   File baseDir = contextFile.getParentFile();
  -                if (appBase.getCanonicalPath().equals(baseDir.getCanonicalPath())) {
  +                if (appBase.getCanonicalPath().equals
  +                    (baseDir.getCanonicalPath())) {
                       isAppBase = true;
                   }
   
  @@ -655,7 +660,8 @@
                   }
                   // Only remove directory and/or war if they are located in the
                   // Host's appBase and autoDeploy or liveDeploy are true
  -                if (isAppBase && (host.getAutoDeploy() || host.getLiveDeploy())) {
  +                if (isAppBase && 
  +                    (host.getAutoDeploy() || host.getLiveDeploy())) {
                       String filename = contextFile.getName();
                       if (isWAR) {
                           filename = filename.substring(0,filename.length()-4);
  @@ -669,7 +675,8 @@
                                   deleteDir(contextFile);
                               }
                               if (host.isUnpackWARs()) {
  -                                File contextWAR = new File(context.getDocBase() + 
".war");
  +                                File contextWAR = 
  +                                    new File(context.getDocBase() + ".war");
                                   if (contextWAR.exists()) {
                                       if (contextLastModified 
                                           > contextWAR.lastModified()) {
  @@ -681,8 +688,8 @@
                               contextFile.delete();
                           }
                       }
  -                    if (host.isDeployXML()) {
  -                        File docBaseXml = new File(appBase,filename + ".xml");
  +                    if (host.isDeployXML() && (configFile != null)) {
  +                        File docBaseXml = new File(configFile);
                           docBaseXml.delete();
                       }
                   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to