Hi all, I am facing a problem with unzip a zip file using jar command
Case:-if I use a zip file which contains folder and files inside
Example: 3 files and a folder and 3 files inside the folder
i am using command jar –xf in
java version "1.4.2" ,at AIX 5.0 platform to unzip the zip files
Case1-when I create zip using PKZIP then jar command for unzip works fine
Case2-when I crate zip using koLibRI (Java 1.5 and Java 1.6, using the java.util.zip package) jar command do not unzip properly and files inside the folder are getting unzip outside it and no files are there inside the folder.
A "zipinfo -zhv" reveals the information below for both the zip files
--------------------------------------------------------------------------------
PKZIP-compressed ZIP:
--------------------------------------------------------------------------------
offset of local header from start of archive: 38 (00000026h) bytes
file system or operating system of origin: MS-DOS, OS/2 or NT FAT
version of encoding software: 2.0
minimum file system compatibility required: MS-DOS, OS/2 or NT FAT
minimum software version required to extract: 2.0
compression method: deflated
compression sub-type (deflation): maximum
file security status: not encrypted
extended local header: no
file last modified on (DOS date/time): 2009 Dec 2 13:25:02
32-bit CRC value (hex): 092516ff
compressed size: 171043 bytes
uncompressed size: 1272316 bytes
length of filename: 34 characters
length of extra field: 0 bytes
length of file comment: 0 characters
disk number on which file begins: disk 1
apparent file type: binary
non-MSDOS external file attributes: 000000 hex
MS-DOS file attributes (20 hex): arc
--------------------------------------------------------------------------------
koLibRI-compressed ZIP:
--------------------------------------------------------------------------------
There are an extra 16 bytes preceding this file.
offset of local header from start of archive: 8552 (00002168h) bytes
file system or operating system of origin: MS-DOS, OS/2 or NT FAT
version of encoding software: 2.0
minimum file system compatibility required: MS-DOS, OS/2 or NT FAT
minimum software version required to extract: 2.0
compression method: deflated
compression sub-type (deflation): normal
file security status: not encrypted
extended local header: yes
file last modified on (DOS date/time): 2009 Dec 2 13:35:22
32-bit CRC value (hex): 092516ff
compressed size: 171043 bytes
uncompressed size: 1272316 bytes
length of filename: 34 characters
length of extra field: 0 bytes
length of file comment: 0 characters
disk number on which file begins: disk 1
apparent file type: binary
non-MSDOS external file attributes: 000000 hex
MS-DOS file attributes (00 hex): none
Comparing both of them shows the difference in following attributes
compression sub-type
extended local header:
MS-DOS file attributes (20 hex):
Please help me to get the reason and the solution as well.
Thanks in advance