Skip to content

Commit

Permalink
update zip4j to 2.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeloffner committed Jul 13, 2021
1 parent a4549eb commit aee6925
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 8 deletions.
4 changes: 2 additions & 2 deletions build.number
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#Build Number for ANT. Do not edit!
#Mon Mar 23 18:32:53 CET 2020
build.number=4
#Tue Jul 13 11:30:45 CEST 2021
build.number=5
2 changes: 1 addition & 1 deletion source/java/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
</classpathentry>
<classpathentry kind="lib" path="libs/lucee.jar"/>
<classpathentry kind="lib" path="libs/javax.servlet.jar"/>
<classpathentry kind="lib" path="libs/org.lucee.zip4j-2.1.3.0.jar"/>
<classpathentry kind="lib" path="libs/net.lingala.zip4j-2.9.0.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Binary file added source/java/libs/net.lingala.zip4j-2.9.0.jar
Binary file not shown.
Binary file removed source/java/libs/org.lucee.zip4j-2.1.3.0.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion source/java/src/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Manifest-Version: 1.0
Export-Package: org.lucee.extension.zip.tag
Bundle-ManifestVersion: 2
Require-Bundle: org.lucee.zip4j;bundle-version=2.1.3.0
Require-Bundle: net.lingala.zip4j;bundle-version=2.9.0
8 changes: 4 additions & 4 deletions source/java/src/org/lucee/extension/zip/tag/Zip.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import org.lucee.extension.zip.filter.OrResourceFilter;
import org.lucee.extension.zip.filter.UDFFilter;
import org.lucee.extension.zip.filter.WildcardPatternFilter;
import org.lucee.extension.zip.util.CompressUtil;

import lucee.commons.io.res.Resource;
import lucee.commons.io.res.filter.ResourceFilter;
Expand All @@ -57,7 +58,6 @@
import net.lingala.zip4j.model.enums.CompressionLevel;
import net.lingala.zip4j.model.enums.CompressionMethod;
import net.lingala.zip4j.model.enums.EncryptionMethod;
import net.lingala.zip4j.util.Zip4jUtil;

public final class Zip extends BodyTagImpl {

Expand Down Expand Up @@ -431,7 +431,7 @@ private void actionList() throws PageException, IOException, ZipException {
query.setAt("name", row, path);
query.setAt("size", row, engine.getCastUtil().toDouble(fh.getUncompressedSize())); // TODO do better
query.setAt("type", row, fh.isDirectory() ? "Directory" : "File");
query.setAt("dateLastModified", row, engine.getCreationUtil().createDateTime(Zip4jUtil.dosToJavaTme(fh.getLastModifiedTime())));
query.setAt("dateLastModified", row, engine.getCreationUtil().createDateTime(CompressUtil.dosToJavaTme(fh.getLastModifiedTime())));
query.setAt("crc", row, engine.getCastUtil().toDouble(fh.getCrc()));
query.setAt("compressedSize", row, engine.getCastUtil().toDouble(fh.getCompressedSize()));
query.setAt("comment", row, fh.getFileComment());
Expand Down Expand Up @@ -559,7 +559,7 @@ private void actionUnzip() throws PageException, IOException, ZipException {
if (target instanceof File) {
((File) target).setExecutable(true);// TODO was is executable?
}
target.setLastModified(Zip4jUtil.dosToJavaTme(fh.getLastModifiedTime()));
target.setLastModified(CompressUtil.dosToJavaTme(fh.getLastModifiedTime()));
}
}
finally {
Expand Down Expand Up @@ -615,7 +615,7 @@ private void actionZip() throws PageException, IOException, ZipException {
// causes problems
}
else {
add(out, in.getInputStream(fh), fh.getFileName(), Zip4jUtil.dosToJavaTme(fh.getLastModifiedTime()), true, toZipParameters(fh));
add(out, in.getInputStream(fh), fh.getFileName(), CompressUtil.dosToJavaTme(fh.getLastModifiedTime()), true, toZipParameters(fh));
}
}
}
Expand Down
10 changes: 10 additions & 0 deletions source/java/src/org/lucee/extension/zip/util/CompressUtil.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package org.lucee.extension.zip.util;

import net.lingala.zip4j.util.Zip4jUtil;

public class CompressUtil {

public static long dosToJavaTme(long dosTime) {
return Zip4jUtil.dosToExtendedEpochTme(dosTime);
}
}

0 comments on commit aee6925

Please sign in to comment.