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

jar tool extractor must do a File.mkdirs() instead of File.mkdir()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.2.0
    • 1.2.0
    • tools
    • None
    • jar
    • 1.2beta4
    • sparc
    • solaris_2.5.1
    • Verified

      Consider:

      $ cd /tmp
      $ rm -fr foo
      $ mkdir -p foo/bar
      $ touch foo/bar/file
      $ zip -r file.zip foo/bar
      adding: foo/bar/ (stored 0%)
      adding: foo/bar/file (stored 0%)
      $ rm -fr t
      $ mkdir t
      $ cd t
      $ /usr/local/java/jdk1.2/solaris/bin/jar xvf ../file.zip
      java.io.IOException: foo/bar/: could not create directory
      at sun.tools.jar.Main.extractFile(Main.java:404)
      at sun.tools.jar.Main.extract(Main.java:384)
      at sun.tools.jar.Main.run(Main.java:105)
      at sun.tools.jar.Main.main(Main.java:533)

      The problem is the the zip archive contains the directory entry for
      "foo/bar/", but not for "foo/" and jar doesn't have a "mkdir -p"
      like behavior.

      See also comments for a message about how this can be a build
      problem.

      anand.palaniswamy@Eng 1998-04-28

            zlisunw Zhenghua Li (Inactive)
            apalanissunw Anand Palaniswamy (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: