Author: bodewig
Date: Wed Feb 17 13:10:33 2010
New Revision: 910958
URL: http://svn.apache.org/viewvc?rev=910958&view=rev
Log:
embrace Commons Compress 1.1
Modified:
ant/antlibs/compress/trunk/docs/index.html
ant/antlibs/compress/trunk/project-template.ivy.xml
ant/antlibs/compress/trunk/project-template.pom
ant/antlibs/compress/trunk/src/main/org/apache/ant/compress/resources/CommonsCompressArchiveResource.java
ant/antlibs/compress/trunk/src/main/org/apache/ant/compress/resources/ZipResource.java
ant/antlibs/compress/trunk/src/main/org/apache/ant/compress/taskdefs/ExpandBase.java
ant/antlibs/compress/trunk/src/main/org/apache/ant/compress/util/EntryHelper.java
Modified: ant/antlibs/compress/trunk/docs/index.html
URL:
http://svn.apache.org/viewvc/ant/antlibs/compress/trunk/docs/index.html?rev=910958&r1=910957&r2=910958&view=diff
==============================================================================
--- ant/antlibs/compress/trunk/docs/index.html (original)
+++ ant/antlibs/compress/trunk/docs/index.html Wed Feb 17 13:10:33 2010
@@ -28,18 +28,12 @@
<p>This Antlib contains tasks and resources that provide
compression/uncompression and archival/unarchival capabilities
based on <a href="http://commons.apache.org/compress/">Apache
- Commons Compress</a>. Using Apache Commons Compress 1.0 this
+ Commons Compress</a>. Using Apache Commons Compress 1.1 this
Antlib supports gzip and bzip2 compression and ar, cpio, tar and
zip archives.</p>
<h3>Known Limitations</h3>
- <p>Using Apache Commons Compress 1.0 the AR and CPIO formats don't
- read or write timestamps, permissions, userids and groupids
- properly - this has been fixed in the svn trunk of Apache
- Commons Compress and will be fixed with the next release of
- it.</p>
-
<p>Reading AR archives from non-filesystem resources currently
fails for reasons that haven't been investigated, yet. Most
likely the problem is within Apache Commons Compress.</p>
@@ -94,7 +88,7 @@
<h3>Installing and Using</h3>
<p>This Antlib requires Apache Ant 1.8.0 or higher and Apache
- Commons Compress 1.0 or higher.</p>
+ Commons Compress 1.1 or higher.</p>
<p>If you are building the Antlib from sources, run
the <code>antlib</code> target and you'll get a
Modified: ant/antlibs/compress/trunk/project-template.ivy.xml
URL:
http://svn.apache.org/viewvc/ant/antlibs/compress/trunk/project-template.ivy.xml?rev=910958&r1=910957&r2=910958&view=diff
==============================================================================
--- ant/antlibs/compress/trunk/project-template.ivy.xml (original)
+++ ant/antlibs/compress/trunk/project-template.ivy.xml Wed Feb 17 13:10:33 2010
@@ -35,6 +35,6 @@
<dependencies>
<dependency org="org.apache.ant" name="ant" revision="[1.8.0,)"/>
<dependency org="org.apache.commons" name="commons-compress"
- revision="[1.0,)"/>
+ revision="[1.1,)"/>
</dependencies>
</ivy-module>
Modified: ant/antlibs/compress/trunk/project-template.pom
URL:
http://svn.apache.org/viewvc/ant/antlibs/compress/trunk/project-template.pom?rev=910958&r1=910957&r2=910958&view=diff
==============================================================================
--- ant/antlibs/compress/trunk/project-template.pom (original)
+++ ant/antlibs/compress/trunk/project-template.pom Wed Feb 17 13:10:33 2010
@@ -39,7 +39,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
- <version>[1.0,)</version>
+ <version>[1.1,)</version>
</dependency>
</dependencies>
</project>
Modified:
ant/antlibs/compress/trunk/src/main/org/apache/ant/compress/resources/CommonsCompressArchiveResource.java
URL:
http://svn.apache.org/viewvc/ant/antlibs/compress/trunk/src/main/org/apache/ant/compress/resources/CommonsCompressArchiveResource.java?rev=910958&r1=910957&r2=910958&view=diff
==============================================================================
---
ant/antlibs/compress/trunk/src/main/org/apache/ant/compress/resources/CommonsCompressArchiveResource.java
(original)
+++
ant/antlibs/compress/trunk/src/main/org/apache/ant/compress/resources/CommonsCompressArchiveResource.java
Wed Feb 17 13:10:33 2010
@@ -213,7 +213,7 @@
}
setName(e.getName());
setExists(true);
- setLastModified(EntryHelper.getLastModified(e).getTime());
+ setLastModified(e.getLastModifiedDate().getTime());
setDirectory(e.isDirectory());
setSize(e.getSize());
setMode(EntryHelper.getMode(e));
Modified:
ant/antlibs/compress/trunk/src/main/org/apache/ant/compress/resources/ZipResource.java
URL:
http://svn.apache.org/viewvc/ant/antlibs/compress/trunk/src/main/org/apache/ant/compress/resources/ZipResource.java?rev=910958&r1=910957&r2=910958&view=diff
==============================================================================
---
ant/antlibs/compress/trunk/src/main/org/apache/ant/compress/resources/ZipResource.java
(original)
+++
ant/antlibs/compress/trunk/src/main/org/apache/ant/compress/resources/ZipResource.java
Wed Feb 17 13:10:33 2010
@@ -186,7 +186,7 @@
super.setEntry(e);
if (e != null) {
ZipArchiveEntry ze = (ZipArchiveEntry) e;
- extras = ze.getExtraFields();
+ extras = ze.getExtraFields(true);
method = ze.getMethod();
}
}
Modified:
ant/antlibs/compress/trunk/src/main/org/apache/ant/compress/taskdefs/ExpandBase.java
URL:
http://svn.apache.org/viewvc/ant/antlibs/compress/trunk/src/main/org/apache/ant/compress/taskdefs/ExpandBase.java?rev=910958&r1=910957&r2=910958&view=diff
==============================================================================
---
ant/antlibs/compress/trunk/src/main/org/apache/ant/compress/taskdefs/ExpandBase.java
(original)
+++
ant/antlibs/compress/trunk/src/main/org/apache/ant/compress/taskdefs/ExpandBase.java
Wed Feb 17 13:10:33 2010
@@ -128,7 +128,7 @@
empty = false;
log("extracting " + ent.getName(), Project.MSG_DEBUG);
extractFile(FileUtils.getFileUtils(), null, dir, is,
- ent.getName(), EntryHelper.getLastModified(ent),
+ ent.getName(), ent.getLastModifiedDate(),
ent.isDirectory(), mapper);
}
if (empty && getFailOnEmptyArchive()) {
Modified:
ant/antlibs/compress/trunk/src/main/org/apache/ant/compress/util/EntryHelper.java
URL:
http://svn.apache.org/viewvc/ant/antlibs/compress/trunk/src/main/org/apache/ant/compress/util/EntryHelper.java?rev=910958&r1=910957&r2=910958&view=diff
==============================================================================
---
ant/antlibs/compress/trunk/src/main/org/apache/ant/compress/util/EntryHelper.java
(original)
+++
ant/antlibs/compress/trunk/src/main/org/apache/ant/compress/util/EntryHelper.java
Wed Feb 17 13:10:33 2010
@@ -30,35 +30,11 @@
/**
* Helper methods that gloss over API differences between the
- * ArchiveEntry implementations of Apache Commons Compress 1.0.
+ * ArchiveEntry implementations of Apache Commons Compress 1.1.
*/
public class EntryHelper {
private EntryHelper() {}
- /**
- * Can be replaced with entry.getLastModifiedDate in ACC 1.1
- */
- public static Date getLastModified(ArchiveEntry entry) {
- if (entry == null) {
- throw new IllegalArgumentException("entry must not be null.");
- }
-
- if (entry instanceof ArArchiveEntry) {
- return new Date(((ArArchiveEntry) entry).getLastModified() * 1000);
- }
- if (entry instanceof CpioArchiveEntry) {
- return new Date(((CpioArchiveEntry) entry).getTime() * 1000);
- }
- if (entry instanceof TarArchiveEntry) {
- return ((TarArchiveEntry) entry).getModTime();
- }
- if (entry instanceof ZipArchiveEntry) {
- return new Date(((ZipArchiveEntry) entry).getTime());
- }
- throw new BuildException("archive entry " + entry.getClass()
- + " is not supported.");
- }
-
// REVISIT: are the "mode" formats really compatible with each other?
/**
* Extracts the permission bits from an entry.