Bug 368523 - [index] Provide an API to validate a given index file
Summary: [index] Provide an API to validate a given index file
Status: VERIFIED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.8   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 3.8 M5   Edit
Assignee: Satyam Kandula CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-13 04:58 EST by Satyam Kandula CLA
Modified: 2017-05-10 04:57 EDT (History)
4 users (show)

See Also:


Attachments
Proposed patch (15.96 KB, patch)
2012-01-13 05:08 EST, Satyam Kandula CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Satyam Kandula CLA 2012-01-13 04:58:05 EST
As part of bug 356620 and bug 365446, users can specify the index file for a given jar. Users can specify the index file through UI (bug 364287). As part of this, an API is required to validate the index file.
Comment 1 Satyam Kandula CLA 2012-01-13 05:08:13 EST
Created attachment 209438 [details]
Proposed patch

Added new API JavaConventions.validateIndexFile(IPath jarLocation, URL indexURL) so that one can verify the index file is good.
Comment 2 Satyam Kandula CLA 2012-01-13 05:12:51 EST
Jay, Can you please review?
Comment 3 Deepak Azad CLA 2012-01-13 08:29:41 EST
(In reply to comment #1)
> Added new API JavaConventions.validateIndexFile(IPath jarLocation, URL
> indexURL) so that one can verify the index file is good.

Satyam, what sort of validation happens here..
- The API verifies that the indexURL indeed points to an index file? 
- Does the API also verify that the index file corresponds to the jar specified by jarLocation? If not, do you really need jarLocation ?
Comment 4 Jay Arthanareeswaran CLA 2012-01-13 08:44:40 EST
Satyam, some minor points/questions on the patch:

1. As Deepak mentioned, the jarLocation is not really used in this case.

2. The constant INDEX_FILE_NOT_ABLE_TO_READ can be better named, e.g.
UNREADABLE_INDEX_FILE

3. In the javadoc of the constants, we should have an empty line before @since.
I also noticed the previous two constants (one of them from me!) have the same
problem. May be we can fix them too, now.

4. ClasspathEntry being internal, the @since tag is not required.
Comment 5 Deepak Azad CLA 2012-01-16 04:08:05 EST
Since there is no UI, see bug 364287, there is no need for this API.