Bug 15044

Summary: Unable to view some non-java files in external jars
Product: [Eclipse Project] JDT Reporter: Stef van Dijk <svandijk>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2    
Version: 2.0   
Target Milestone: 2.0 M6   
Hardware: PC   
OS: Windows 2000   
Whiteboard:
Attachments:
Description Flags
simpe zip containing two .txt files none

Description Stef van Dijk CLA 2002-05-01 16:42:55 EDT
Attached is a very simple jar. It contains 2 text files where one is at the 
root of the jar and the other is contained in a subdirectory. Create a project 
and add the jar to the Java Build Path as an External Jar. In the Packages 
View, expand the jar to see the files. Double-clicking on the root file 
(readme.txt) successfully opens a text editor. However, double-clicking on the 
file in the subdirectory (copyright.txt) results in the error:
   Cannot open Java editor on copyright.txt. Invalid path: null.

The problem seems to be in the class JarEntryFile. The path field is 
constructed from just the simple entryName, so it does not contain the actual 
path information. Thus the method getContents() fails because it is unable to 
properly locate the zip entry.

This is important to us as we need to be able to read the manifest.mf file in 
the META-INF directory of externals jars. This used to work in Eclipse 1.0.
Comment 1 Stef van Dijk CLA 2002-05-01 16:43:48 EDT
Created attachment 734 [details]
simpe zip containing two .txt files
Comment 2 Erich Gamma CLA 2002-05-02 18:50:53 EDT
moving to JDT CORE for investigation
Comment 3 Olivier Thomann CLA 2002-05-03 11:54:56 EDT
Now I am adding the package name (replacing '.' with '/') in front of the entry name. This fixed the 
problem.
Comment 4 Olivier Thomann CLA 2002-05-03 16:48:57 EDT
Fixed. I need to way before I can release it that the patch for M5 is out.
Comment 5 Olivier Thomann CLA 2002-05-03 16:59:11 EDT
Released in HEAD.