Bug 15044 - Unable to view some non-java files in external jars
Summary: Unable to view some non-java files in external jars
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P2 normal (vote)
Target Milestone: 2.0 M6   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-05-01 16:42 EDT by Stef van Dijk CLA
Modified: 2002-05-03 16:59 EDT (History)
0 users

See Also:


Attachments
simpe zip containing two .txt files (366 bytes, application/octet-stream)
2002-05-01 16:43 EDT, Stef van Dijk CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.