yoavs       2005/03/23 07:02:58

  Modified:    catalina/src/share/org/apache/catalina/startup
                        ExpandWar.java
               webapps/docs changelog.xml
  Log:
  Bugzilla 33636: set lastModified attribute on files expanded from WARs.
  
  Revision  Changes    Path
  1.11      +12 -3     
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/ExpandWar.java
  
  Index: ExpandWar.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/ExpandWar.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- ExpandWar.java    1 Feb 2005 13:12:31 -0000       1.10
  +++ ExpandWar.java    23 Mar 2005 15:02:58 -0000      1.11
  @@ -152,7 +152,14 @@
                       continue;
                   }
                   input = jarFile.getInputStream(jarEntry);
  -                expand(input, docBase, name);
  +
  +                // Bugzilla 33636
  +                File expandedFile = expand(input, docBase, name);
  +                long lastModified = jarEntry.getTime();
  +                if ((lastModified != -1) && (lastModified != 0) && 
(expandedFile != null)) {
  +                    expandedFile.setLastModified(lastModified);
  +                }
  +
                   input.close();
                   input = null;
               }
  @@ -291,10 +298,11 @@
        * @param input InputStream to be copied
        * @param docBase Document base directory into which we are expanding
        * @param name Relative pathname of the file to be created
  +     * @return A handle to the expanded File
        *
        * @exception IOException if an input/output error occurs
        */
  -    protected static void expand(InputStream input, File docBase, String 
name)
  +    protected static File expand(InputStream input, File docBase, String 
name)
           throws IOException {
   
           File file = new File(docBase, name);
  @@ -319,6 +327,7 @@
               }
           }
   
  +        return file;
       }
   
   
  
  
  
  1.245     +3 -0      jakarta-tomcat-catalina/webapps/docs/changelog.xml
  
  Index: changelog.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/docs/changelog.xml,v
  retrieving revision 1.244
  retrieving revision 1.245
  diff -u -r1.244 -r1.245
  --- changelog.xml     15 Mar 2005 13:06:31 -0000      1.244
  +++ changelog.xml     23 Mar 2005 15:02:58 -0000      1.245
  @@ -78,6 +78,9 @@
           <bug>34016</bug>: Save and restore docBase when using 
antiResourceLocking, for compatibility with
           the admin webapp (remm)
         </fix>
  +      <update>
  +        <bug>33636</bug>: Set lastModified attribute when expanding WAR 
files. (yoavs)
  +      </update>
       </changelog>
      </subsection>
      
  
  
  

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

Reply via email to