src/share/classes/java/util/zip/ZipFile.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 565,612 ****
e.name = zc.toStringUTF8(bname, bname.length);
} else {
e.name = zc.toString(bname, bname.length);
}
}
e.crc = getEntryCrc(jzentry);
e.size = getEntrySize(jzentry);
! e. csize = getEntryCSize(jzentry);
e.method = getEntryMethod(jzentry);
! e.extra = getEntryBytes(jzentry, JZENTRY_EXTRA);
! if (e.extra != null) {
! byte[] extra = e.extra;
! int len = e.extra.length;
! int off = 0;
! while (off + 4 < len) {
! int pos = off;
! int tag = get16(extra, pos);
! int sz = get16(extra, pos + 2);
! pos += 4;
! if (pos + sz > len) // invalid data
! break;
! switch (tag) {
! case EXTID_NTFS:
! pos += 4; // reserved 4 bytes
! if (get16(extra, pos) != 0x0001 || get16(extra, pos + 2) != 24)
! break;
! e.mtime = winToJavaTime(get64(extra, pos + 4));
! break;
! case EXTID_EXTT:
! int flag = Byte.toUnsignedInt(extra[pos++]);
! if ((flag & 0x1) != 0) {
! e.mtime = unixToJavaTime(get32(extra, pos));
! pos += 4;
! }
! break;
! default: // unknown tag
! }
! off += (sz + 4);
! }
! }
! if (e.mtime == -1) {
! e.mtime = dosToJavaTime(getEntryTime(jzentry));
! }
byte[] bcomm = getEntryBytes(jzentry, JZENTRY_COMMENT);
if (bcomm == null) {
e.comment = null;
} else {
if (!zc.isUTF8() && (e.flag & EFS) != 0) {
--- 565,580 ----
e.name = zc.toStringUTF8(bname, bname.length);
} else {
e.name = zc.toString(bname, bname.length);
}
}
+ e.time = dosToJavaTime(getEntryTime(jzentry));
e.crc = getEntryCrc(jzentry);
e.size = getEntrySize(jzentry);
! e.csize = getEntryCSize(jzentry);
e.method = getEntryMethod(jzentry);
! e.setExtra0(getEntryBytes(jzentry, JZENTRY_EXTRA), false);
byte[] bcomm = getEntryBytes(jzentry, JZENTRY_COMMENT);
if (bcomm == null) {
e.comment = null;
} else {
if (!zc.isUTF8() && (e.flag & EFS) != 0) {