The current (1.4) JAR file specification lists the following grammar for JAR
index files:
index file : version-info blankline section*
version-info : JarIndex-Version: version-number
version-number : digit+{.digit+}*
section : body blankline
body : header name*
header : char+.jar newline
name : char+ newline
char : any valid Unicode character except NULL, CR and LF
blankline : newline newline
newline : CR LF | LF | CR (not followed by LF)
digit : {0-9}
According to this grammar, each section header line must end in the characters
".jar". Since section headers are where JAR file names are specified in JAR
file indexes, this means that JAR file indexes can only be used to index JAR
files whose names end in ".jar". This is an arbitrary restriction that is not
present elsewhere in the JDK: for instance, java.net.URLClassLoader interprets
any URL path that doesn't end in the character '/' as referring to a jar file.
Since the JDK does not require that jar files names end with ".jar", it seems
overly restrictive for JAR indexes to do so.
Furthermore, this restriction is unnecessary from the standpoint of parsing the
JAR index file. Individual sections are already separated by blank lines, so
each section header is clearly identifiable, even without the ".jar" suffix.
Therefore, this RFE proposes that the JAR file specification be modified to
allow section headers that do not end in ".jar". Specifically, the grammar
production for "header" should be changed to:
header : char+ newline
Also, the sun.misc.JarIndex class, which is responsible for handling JAR file
indexes, should be updated accordingly.
index files:
index file : version-info blankline section*
version-info : JarIndex-Version: version-number
version-number : digit+{.digit+}*
section : body blankline
body : header name*
header : char+.jar newline
name : char+ newline
char : any valid Unicode character except NULL, CR and LF
blankline : newline newline
newline : CR LF | LF | CR (not followed by LF)
digit : {0-9}
According to this grammar, each section header line must end in the characters
".jar". Since section headers are where JAR file names are specified in JAR
file indexes, this means that JAR file indexes can only be used to index JAR
files whose names end in ".jar". This is an arbitrary restriction that is not
present elsewhere in the JDK: for instance, java.net.URLClassLoader interprets
any URL path that doesn't end in the character '/' as referring to a jar file.
Since the JDK does not require that jar files names end with ".jar", it seems
overly restrictive for JAR indexes to do so.
Furthermore, this restriction is unnecessary from the standpoint of parsing the
JAR index file. Individual sections are already separated by blank lines, so
each section header is clearly identifiable, even without the ".jar" suffix.
Therefore, this RFE proposes that the JAR file specification be modified to
allow section headers that do not end in ".jar". Specifically, the grammar
production for "header" should be changed to:
header : char+ newline
Also, the sun.misc.JarIndex class, which is responsible for handling JAR file
indexes, should be updated accordingly.