Browse Source

JDK 1.3-

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@277027 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 20 years ago
parent
commit
52bdd44cde
1 changed files with 5 additions and 5 deletions
  1. +5
    -5
      src/main/org/apache/tools/zip/ZipOutputStream.java

+ 5
- 5
src/main/org/apache/tools/zip/ZipOutputStream.java View File

@@ -581,7 +581,7 @@ public class ZipOutputStream extends FilterOutputStream {
written += 2; written += 2;


// last mod. time and date // last mod. time and date
writeOut(toDosTime(ze.getTime()));
writeOut(toDosTime(new Date(ze.getTime())));
written += 4; written += 4;


// CRC // CRC
@@ -669,7 +669,7 @@ public class ZipOutputStream extends FilterOutputStream {
written += 2; written += 2;


// last mod. time and date // last mod. time and date
writeOut(toDosTime(ze.getTime()));
writeOut(toDosTime(new Date(ze.getTime())));
written += 4; written += 4;


// CRC // CRC
@@ -770,7 +770,7 @@ public class ZipOutputStream extends FilterOutputStream {
* @since 1.1 * @since 1.1
*/ */
protected static ZipLong toDosTime(Date time) { protected static ZipLong toDosTime(Date time) {
return new ZipLong(toDosTime(time.getTime()));
return new ZipLong(toDosTime(time));
} }


/** /**
@@ -780,9 +780,9 @@ public class ZipOutputStream extends FilterOutputStream {
* *
* @since 1.26 * @since 1.26
*/ */
protected static byte[] toDosTime(long time) {
protected static byte[] toDosTime(Date time) {
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(time);
cal.setTime(time);
int year = cal.get(Calendar.YEAR); int year = cal.get(Calendar.YEAR);
if (year < 1980) { if (year < 1980) {
return DOS_TIME_MIN.getBytes(); return DOS_TIME_MIN.getBytes();


Loading…
Cancel
Save