You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by at...@apache.org on 2008/07/18 23:30:58 UTC

svn commit: r678046 - /portals/jetspeed-2/portal/trunk/components/jetspeed-deploy-tools/src/main/java/org/apache/jetspeed/tools/deploy/JetspeedDeploy.java

Author: ate
Date: Fri Jul 18 14:30:58 2008
New Revision: 678046

URL: http://svn.apache.org/viewvc?rev=678046&view=rev
Log:
JS2-894: Deploy tool does not keep file dates in WAR file
See: http://issues.apache.org/jira/browse/JS2-894
Patch provided by Ron McNulty, thanks!

Modified:
    portals/jetspeed-2/portal/trunk/components/jetspeed-deploy-tools/src/main/java/org/apache/jetspeed/tools/deploy/JetspeedDeploy.java

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-deploy-tools/src/main/java/org/apache/jetspeed/tools/deploy/JetspeedDeploy.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-deploy-tools/src/main/java/org/apache/jetspeed/tools/deploy/JetspeedDeploy.java?rev=678046&r1=678045&r2=678046&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-deploy-tools/src/main/java/org/apache/jetspeed/tools/deploy/JetspeedDeploy.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-deploy-tools/src/main/java/org/apache/jetspeed/tools/deploy/JetspeedDeploy.java Fri Jul 18 14:30:58 2008
@@ -150,7 +150,7 @@
                             System.out.println("Warning: WEB-INF/tld/portlet.tld already provided, won't be replaced.");
                             taglibFound = true;
                         }
-                        addFile(target, source, jout);
+                        addFile(target, source, jout, src.getTime());
                     }
                 }
                 finally
@@ -196,7 +196,7 @@
 
                     try
                     {
-                        addFile("WEB-INF/tld/portlet.tld", is, jout);
+                        addFile("WEB-INF/tld/portlet.tld", is, jout, 0);
                     }
                     finally
                     {
@@ -301,9 +301,14 @@
         return document;
     }
 
-    protected void addFile(String path, InputStream source, JarOutputStream jos) throws IOException
+    protected void addFile(String path, InputStream source, JarOutputStream jos, long fileTime) throws IOException
     {
-        jos.putNextEntry(new ZipEntry(path));
+        ZipEntry ze = new ZipEntry(path);
+        if (fileTime > 0)
+        {
+            ze.setTime(fileTime);
+        }
+        jos.putNextEntry(ze);
         try
         {
             int count;



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