Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8184973

jar -xf is loosing symbolic references and treating them as regular files

    Details

    • Subcomponent:
      jar
    • CPU:
      x86
    • OS:
      generic

      Description

      FULL PRODUCT VERSION :
      java version "1.8.0_131"
      Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
      Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)


      ADDITIONAL OS VERSION INFORMATION :
      Windows 8

      zip file created with symbolic links retains the symbolic link when extracted from .zip file
      Where as jar treat symbolic links as regular files.

      1> Creat symbolic link for Test.java file
      -sh-4.2$ ln -s Test.java Test2.java
      -sh-4.2$ ls
      Test2.java Test.java

      2> zip using -y option
      -sh-4.2$ zip -y abc.zip Test.java Test2.java
        adding: Test.java (stored 0%)
        adding: Test2.java (stored 0%)
      -sh-4.2$ ls

      3> unzip using unzip command
      -sh-4.2$ unzip abc.zip
      Archive: abc.zip
       extracting: Test.java
          linking: Test2.java -> Test.java
      finishing deferred symbolic links:
        Test2.java -> Test.java

      4>unzip using jar-xf command
      jar -xf abc.zip
      -sh-4.2$ ls
      abc.zip Test2.java Test.java
      -sh-4.2$ ls -la
      total 16
      drwxr-xr-x 2 fmatte dba 4096 Jul 19 22:24 .
      drwxr-xr-x 4 fmatte dba 4096 Jul 19 22:22 ..
      -rw-r--r-- 1 fmatte dba 325 Jul 19 22:22 abc.zip
      -rw-r--r-- 1 fmatte dba 9 Jul 19 22:17 Test2.java
      -rw-r--r-- 1 fmatte dba 0 Jul 19 22:16 Test.java

      Test.java and Test2.java are shown as regular files. Test2.java is actual symbolic link file which is loast after jar -xf

        Attachments

          Activity

            People

            • Assignee:
              sherman Xueming Shen
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: