remm        2005/03/14 03:52:04

  Modified:    catalina/src/share/org/apache/catalina/startup
                        HostConfig.java
  Log:
  - 34006: If antiResourceLocking was used, the old code considered the path as 
external (bad).
  - Simplify code a lot, as the case where the docBase is an external path is 
handled in the beginning before starting the context.
  
  Revision  Changes    Path
  1.59      +14 -38    
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.58
  retrieving revision 1.59
  diff -u -r1.58 -r1.59
  --- HostConfig.java   17 Feb 2005 00:46:14 -0000      1.58
  +++ HostConfig.java   14 Mar 2005 11:52:04 -0000      1.59
  @@ -614,46 +614,22 @@
                       (contextXml.getAbsolutePath(), new 
Long(contextXml.lastModified()));
                   addWatchedResources(deployedApp, 
expandedDocBase.getAbsolutePath(), context);
               } else {
  -                if (context.getDocBase() != null) {
  -                    // If the context is outside of the Host appBase, 
removing the xml
  -                    // should remove the webapp
  -                    boolean external = false;
  -                    File docBase = new File(context.getDocBase());
  -                    if (!docBase.isAbsolute()) {
  -                        docBase = new File(appBase(), context.getDocBase());
  -                    }
  -                    try {
  -                        docBase = docBase.getCanonicalFile();
  -                        if 
(!docBase.getAbsolutePath().startsWith(appBase().getAbsolutePath())) {
  -                            external = true;
  -                            deployedApp.redeployResources.put
  -                                (contextXml.getAbsolutePath(), new 
Long(contextXml.lastModified()));
  -                        }
  -                    } catch (IOException e) {
  -                        // Ignore
  -                    }
  -                    if (!external) {
  -                        // Find an existing matching war and expanded folder
  -                        if (warDocBase.exists()) {
  -                            
deployedApp.redeployResources.put(warDocBase.getAbsolutePath(),
  -                                    new Long(warDocBase.lastModified()));
  -                        }
  -                        if (expandedDocBase.exists()) {
  -                            
deployedApp.redeployResources.put(expandedDocBase.getAbsolutePath(),
  -                                    new 
Long(expandedDocBase.lastModified()));
  -                            addWatchedResources(deployedApp, 
  -                                    expandedDocBase.getAbsolutePath(), 
context);
  -                        }
  -                        // Add the context XML to the list of files which 
should trigger a redeployment
  -                        deployedApp.redeployResources.put
  -                            (contextXml.getAbsolutePath(), new 
Long(contextXml.lastModified()));
  -                    }
  +                // Find an existing matching war and expanded folder
  +                if (warDocBase.exists()) {
  +                    
deployedApp.redeployResources.put(warDocBase.getAbsolutePath(),
  +                            new Long(warDocBase.lastModified()));
  +                }
  +                if (expandedDocBase.exists()) {
  +                    
deployedApp.redeployResources.put(expandedDocBase.getAbsolutePath(),
  +                            new Long(expandedDocBase.lastModified()));
  +                    addWatchedResources(deployedApp, 
  +                            expandedDocBase.getAbsolutePath(), context);
                   } else {
  -                    // Add the context XML to the list of files which should 
trigger a redeployment
  -                    deployedApp.redeployResources.put
  -                        (contextXml.getAbsolutePath(), new 
Long(contextXml.lastModified()));
                       addWatchedResources(deployedApp, null, context);
                   }
  +                // Add the context XML to the list of files which should 
trigger a redeployment
  +                deployedApp.redeployResources.put
  +                    (contextXml.getAbsolutePath(), new 
Long(contextXml.lastModified()));
               }
           } catch (Throwable t) {
               log.error(sm.getString("hostConfig.deployDescriptor.error",
  
  
  

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

Reply via email to