-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy patha.html
116 lines (115 loc) · 6.07 KB
/
a.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Version IDs and Version Strings</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
</head>
<body>
<hr>
<h1>A Version IDs and Version Strings </h1>
<hr>
<p>This section is simply a formal encoding of common conventions for dot-notations.
The formal syntax is to ensure predictable behavior of the download protocols.
</p>
<p>This section describes the formal syntax of the version-ids and version strings
used in this specification. A version-id is an exact version that is associated
with a resource, such as a JAR file. A version string is a key that can match
one or more version-ids. </p>
<p>The version-id used in this specification must conform to the following syntax:</p>
<blockquote>
<p><code>version-id ::= string ( separator string ) *<br>
string ::= char ( char ) *<br>
char ::= any ASCII character except a
space, an ampersand, a <SPAN LANG="en-US">separator</SPAN>, or a modifier.
<br>
separator ::= "." | "-" | "_" </code></p>
</blockquote>
<p>A version string is a list of version-ids separated with spaces. Each version-id
can be postfixed with a '+' to indicate a greater-than-or-equal match, a "*"
to indicated a prefix match, or have no postfix to indicate an exact match.
The syntax of version-strings is:</p>
<blockquote>
<p><code>version-string ::= version-range ( "
" element) * <BR>
version-range ::= simple-range ( "&"
simple-element) * <BR>
simple-range ::= version-id | version-id
modifier <BR>
modifier ::=
`+` | '*' </code></p>
</blockquote>
<p>A version-id can be described as a tuple of values. A version-id string is
broken in parts for each separator ('.', '-', or '_'). For example, "1.3.0-rc2-w"
becomes (1,3,0,rc2,w), and "1.2.2-001" becomes (1,2,2,001).</p>
<p>Each element in a tuple is treated as either a numeric or alphanumeric. Two
elements are compared numerically if they can both be parsed as Java <code>ints</code>,
otherwise they are compared lexicographically according to the ASCII value<SUP><a href="javascript:;" onClick="MM_openBrWindow('notes.html#15','','scrollbars=yes,resizable=yes,width=500,height=700')">15</a></SUP>
of the individual characters. </p>
<p>Before two version-ids are compared the two tuples are <em>normalized</em>.
This means that the shortest tuple is padded with 0 (zero element) entries at
the end. Two normalized tuples are always of the same length. For example, comparing
(1, 3) and (1, 3, 1), will result in comparing (1, 3, 0) and (1, 3, 1). </p>
<h2>A.1 Ordering</h2>
<p>The version-ids are ordered by the natural ordering of dot-notations. </p>
<p>A normalized version-id tuple can be written as (<em>Head Tail</em>), where
<em>Head</em> is the first element in the tuple, and <em>Tail</em> is the rest<SUP><a href="javascript:;" onClick="MM_openBrWindow('notes.html#16','','scrollbars=yes,resizable=yes,width=500,height=700')">16</a></SUP>.
</p>
<p>Given two version-ids, (HA TA) and (HB TB), then (HA TA) is greater than (HB
TB) if and only if:</p>
<ul>
<li>HA is greater than HB, or</li>
<li>HA is equal to HB, TA and TB are not empty, and TA is greater than TB recursively</li>
</ul>
<p>In other words, A is greater than B if, when represented as normalized tuples,
there exists some element of A which is greater than the corresponding element
of B, and all earlier elements of A are the same as in B.</p>
<p>For example, "1.2.2" is greater than "1.2", and less than
"1.3" (i.e., in effect, comparing "1.2.2", "1.2.0",
and "1.3.0")</p>
<h2>A.2 Exact Match</h2>
<p>Two normalized version-ids, (HA TA) and (HB TB), match exactly if and only
if:</p>
<ul>
<li>HA is equal to HB and </li>
<li>TA and TB are both empty, or TA matches TB exactly.</li>
</ul>
<p>In other words, A is an exact match of B if, when represented as normalized
tuples, the elements of A are the same as the elements of B.</p>
<p>For example, given the above definition "1.2.2-004" will be an exact
match for "1.2.2.4", and "1.3" is an exact match of "1.3.0".</p>
<h2>A.3 Prefix Match</h2>
<p>Given two version-ids, (HA TA) and (HB TB), then first (HB TB) is padded with
0 (zero element) entries at the end so it is at least the same length as the
(HA TA) tuple. </p>
<p>(HA TA) is a prefix match of (HB TB) if and only if:</p>
<ul>
<li>HA is equal to HB, and
<ul>
<li>TA is empty, or</li>
<li>TA is a prefix match of TB</li>
</ul>
</li>
</ul>
<p>In other words, A is a prefix match of B if, when represented as tuples, the
elements of A are the same as the first elements of B. The padding ensures that
B has at least as many elements as A.</p>
<p>For example, given the above definition "1.2.1" will be a prefix
match to "1.2.1-004", but not to "1.2.0" or "1.2.10".
The padding step ensures that "1.2.0.0" is a prefix of "1.2".
Note that prefix matching and ordering are distinct: "1.3" is greater
than "1.2", and less than "1.4", but not a prefix of either.</p>
<h2>A.4 Version Selection </h2>
<p> If two or more available resources match the given version-string, the JNLP
Client should use the one matching the earlier version-range in the version-string.
If two or more available resources match a given version-range, the JNLP Client
should use the one with the<SPAN LANG="en-US"> highest </SPAN>version-id. </p>
<p> </p>
</body>
</html>