RFR: 8215788: Clarify JarInputStream Manifest access
Lance Andersen
lancea at openjdk.org
Tue Sep 13 17:24:50 UTC 2022
On Fri, 2 Sep 2022 14:50:32 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> I could do tweak further to say:
>>
>> _`getManifest()` will return the Manifest if it is the first entry or META-INF/ is the first entry and the Manifest is the second entry within the Jar file. When the Manifest is returned by `getManifest()`, the `getNextEntry()` and `getNextJarEntry()` methods will not return the Manifest_
>>
>> Is that more what you were thinking?
>
> I read the current draft and it makes we wonder if it would be simpler to just replace the class description with something like this:
>
>
> * The JarInputStream class is used to read the contents of a JAR file from
> * an input stream. It extends ZipInputStream with support for reading an optional
> * manifest named "META-INF/MANIFEST.MF" when it is found at as the first entry in
> * the stream. If the first entry in the stream is "META-INF/" then it is skipped,
> * in which case the manifest is found if it is the second entry in the stream.
> *
> * JarInputStream defines the getNextJarEntry() method to iterate through the
> * JAR file entries in the stream. The method reads the metadata for the next JAR
> * file entry in the stream and positions the input stream to read the entry's
> * file data. The first entry found by getNextJarEntry() (or getNextEntry())
> * will follow the manifest when the manifest is the first entry in the JAR
> * file (or the second entry when the first entry is "META-INF/").
Thank you for the suggestions. I just updated the the description leveraging your feedback. Please let me know if this is better
-------------
PR: https://git.openjdk.org/jdk/pull/10045
More information about the security-dev
mailing list