tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yo...@apache.org
Subject svn commit: r490097 - /tomcat/container/branches/tc5.0.x/catalina/src/share/org/apache/catalina/startup/ExpandWar.java
Date Mon, 25 Dec 2006 02:34:57 GMT
Author: yoavs
Date: Sun Dec 24 18:34:56 2006
New Revision: 490097

URL: http://svn.apache.org/viewvc?view=rev&rev=490097
Log:
Bugzilla 33636: set last modified date in ExpandWar for Tomcat 5.0.

Modified:
    tomcat/container/branches/tc5.0.x/catalina/src/share/org/apache/catalina/startup/ExpandWar.java

Modified: tomcat/container/branches/tc5.0.x/catalina/src/share/org/apache/catalina/startup/ExpandWar.java
URL: http://svn.apache.org/viewvc/tomcat/container/branches/tc5.0.x/catalina/src/share/org/apache/catalina/startup/ExpandWar.java?view=diff&rev=490097&r1=490096&r2=490097
==============================================================================
--- tomcat/container/branches/tc5.0.x/catalina/src/share/org/apache/catalina/startup/ExpandWar.java
(original)
+++ tomcat/container/branches/tc5.0.x/catalina/src/share/org/apache/catalina/startup/ExpandWar.java
Sun Dec 24 18:34:56 2006
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999,2004 The Apache Software Foundation.
+ * Copyright 1999,2004-2006 The Apache Software Foundation.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -182,7 +182,12 @@
                     logger.log("  Creating expanded file " + name);
                 }
                 input = jarFile.getInputStream(jarEntry);
-                expand(input, docBase, name);
+                // Bugzilla 33636: http://issues.apache.org/bugzilla/show_bug.cgi?id=33636
+                File f = expand(input, docBase, name);
+                long lastModified = jarEntry.getTime();
+                if (lastModified != -1  &&  lastModified != 0) {
+                    f.setLastModified(lastModified);
+                }
                 input.close();
                 input = null;
             }
@@ -248,10 +253,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 File, which has been created
      *
      * @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);
@@ -276,7 +282,6 @@
             }
         }
 
+        return file;
     }
-
-
 }



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


Mime
View raw message