commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r799879 - in /commons/proper/compress/trunk/src: main/java/org/apache/commons/compress/archivers/ main/java/org/apache/commons/compress/archivers/ar/ main/java/org/apache/commons/compress/archivers/cpio/ main/java/org/apache/commons/compres...
Date Sat, 01 Aug 2009 14:52:15 GMT
Author: bodewig
Date: Sat Aug  1 14:52:15 2009
New Revision: 799879

URL: http://svn.apache.org/viewvc?rev=799879&view=rev
Log:
add getLastModifiedDate to ArchiveEntry - implement it assuming cpio and ar use seconds since
epoch for their time values

Modified:
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ArchiveEntry.java
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveEntry.java
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveEntry.java
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.java
    commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/memory/MemoryArchiveEntry.java

Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ArchiveEntry.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ArchiveEntry.java?rev=799879&r1=799878&r2=799879&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ArchiveEntry.java
(original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ArchiveEntry.java
Sat Aug  1 14:52:15 2009
@@ -18,6 +18,8 @@
  */
 package org.apache.commons.compress.archivers;
 
+import java.util.Date;
+
 /**
  * Represents an entry of an archive.
  */
@@ -34,4 +36,7 @@
 	
 	/** True if the entry refers to a directory */
 	public boolean isDirectory();
+
+    /** The last modified date of the entry */
+    public Date getLastModifiedDate();
 }

Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveEntry.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveEntry.java?rev=799879&r1=799878&r2=799879&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveEntry.java
(original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveEntry.java
Sat Aug  1 14:52:15 2009
@@ -19,6 +19,7 @@
 package org.apache.commons.compress.archivers.ar;
 
 import java.io.File;
+import java.util.Date;
 
 import org.apache.commons.compress.archivers.ArchiveEntry;
 
@@ -111,6 +112,11 @@
 		return lastModified;
 	}
 	
+    /** {@inheritDocs} */
+    public Date getLastModifiedDate() {
+        return new Date(1000 * getLastModified());
+    }
+
 	public long getLength() {
 		return length;
 	}

Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveEntry.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveEntry.java?rev=799879&r1=799878&r2=799879&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveEntry.java
(original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveEntry.java
Sat Aug  1 14:52:15 2009
@@ -19,6 +19,7 @@
 package org.apache.commons.compress.archivers.cpio;
 
 import java.io.File;
+import java.util.Date;
 
 import org.apache.commons.compress.archivers.ArchiveEntry;
 
@@ -492,6 +493,11 @@
         return this.mtime;
     }
 
+    /** {@inheritDocs} */
+    public Date getLastModifiedDate() {
+        return new Date(1000 * getTime());
+    }
+
     /**
      * Get the user id.
      * 

Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java?rev=799879&r1=799878&r2=799879&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
(original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
Sat Aug  1 14:52:15 2009
@@ -463,6 +463,11 @@
         return new Date(modTime * MILLIS_PER_SECOND);
     }
 
+    /** {@inheritDocs} */
+    public Date getLastModifiedDate() {
+        return getModTime();
+    }
+
     /**
      * Get this entry's file.
      *

Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.java?rev=799879&r1=799878&r2=799879&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.java
(original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.java
Sat Aug  1 14:52:15 2009
@@ -18,6 +18,7 @@
 package org.apache.commons.compress.archivers.zip;
 
 import java.io.File;
+import java.util.Date;
 import java.util.LinkedHashMap;
 import java.util.zip.ZipException;
 import org.apache.commons.compress.archivers.ArchiveEntry;
@@ -391,6 +392,11 @@
         }
     }
 
+    /** {@inheritDocs} */
+    public Date getLastModifiedDate() {
+        return new Date(getTime());
+    }
+
     /* (non-Javadoc)
      * @see java.lang.Object#equals(java.lang.Object)
      */

Modified: commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/memory/MemoryArchiveEntry.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/memory/MemoryArchiveEntry.java?rev=799879&r1=799878&r2=799879&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/memory/MemoryArchiveEntry.java
(original)
+++ commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/memory/MemoryArchiveEntry.java
Sat Aug  1 14:52:15 2009
@@ -18,6 +18,7 @@
  */
 package org.apache.commons.compress.archivers.memory;
 
+import java.util.Date;
 import org.apache.commons.compress.archivers.ArchiveEntry;
 
 public final class MemoryArchiveEntry implements ArchiveEntry {
@@ -42,4 +43,8 @@
 		return false;
 	}
 
+    /** {@inheritDocs} */
+    public Date getLastModifiedDate() {
+        return new Date();
+    }
 }



Mime
View raw message