JDK-6550137 : java.util.zip package does not support unix symbolic links
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util.jar
  • Affected Version: 1.0
  • Priority: P3
  • Status: Resolved
  • Resolution: Won't Fix
  • OS: generic
  • CPU: generic
  • Submitted: 2007-04-25
  • Updated: 2015-11-11
  • Resolved: 2015-11-11
Impossible to detect symlink entries in zip files containing them.

symlinks on unix are common yet with Java it's impossible to detect them and create them appropriately, so any zip file with symlinks is not exploded properly.

This can also be seen using 'jar' to extract a zipfile containing symlinks:

[jhf@spirit]:z$> cd unzip; unzip /tmp/foo.zip; ls -l
Archive:  /tmp/foo.zip
 extracting: a                       
    linking: b                       -> a 
finishing deferred symbolic links:
  b                      -> a
total 8
-rw-r--r--   1 jhf      other          0 Apr 25 10:25 a
lrwxrwxrwx   1 jhf      other          1 Apr 25 10:28 b -> a

[jhf@spirit]:unzip$> cd ../jar; jar xf /tmp/foo.zip; ls -l
total 8
-rw-r--r--   1 jhf      other          0 Apr 25 10:25 a
-rw-r--r--   1 jhf      other          1 Apr 25 10:25 b

zip files with symlinks can be created using "zip -y".

EVALUATION It should be possible to provide this using some of the New I/O APIs in JSR 203.