United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6531294 TimezoneUpdater.extract(File, InputStream) fails if the first entry is a file, not a directory
JDK-6531294 : TimezoneUpdater.extract(File, InputStream) fails if the first entry is a file, not a directory

Details
Type:
Bug
Submit Date:
2007-03-06
Status:
Resolved
Updated Date:
2010-07-29
Project Name:
JDK
Resolved Date:
2007-03-28
Component:
tools
OS:
linux
Sub-Component:
updaters
CPU:
x86
Priority:
P3
Resolution:
Fixed
Affected Versions:
1.1
Fixed Versions:
1.2.0 (b01)

Related Reports

Sub Tasks

Description
TimezoneUpdater.extract(File, InputStream) fails if the first entry is a file, not a directory.

                                    

Comments
EVALUATION

extDir must be created before extracting entries from a zip file.
                                     
2007-03-06
SUGGESTED FIX

------- TimezoneUpdater.java -------
*** /tmp/sccs.XQaqdc    Tue Mar  6 16:04:00 2007
--- TimezoneUpdater.java        Tue Mar  6 16:03:45 2007
***************
*** 287,292 ****
--- 287,298 ----

        Logger.print(Messages.printf("state.extracting"));

+       // Create the destination directory for extraction.
+       if (!extDir.mkdirs()) {
+           Logger.println(Messages.printf("state.failed"));
+           throw new IOException(Messages.printf("error.cannot.mkdir", extDir));
+       }
+
        List dirs = new ArrayList(64);
        byte[] buf = new byte[BUFSIZE];
        ZipEntry entry;
                                     
2007-03-06



Hardware and Software, Engineered to Work Together