308 |
os.writeObject(string); |
os.writeObject(string); |
309 |
} |
} |
310 |
|
|
311 |
|
/** |
312 |
|
* <p> |
313 |
|
* Returns the string content of the specified group of the supplied |
314 |
|
* matcher. The returned value is modified according to the following: |
315 |
|
* </p> |
316 |
|
* <ul> |
317 |
|
* <li>If the resulting string has a length greater than 0, then |
318 |
|
* that string is returned.</li> |
319 |
|
* <li>If a string of zero length, is matched, then the content |
320 |
|
* of the preceding group is considered. If this is also an empty |
321 |
|
* string, then <code>null</code> is returned to indicate an undefined |
322 |
|
* value. Otherwise, the value is truly the empty string and this is |
323 |
|
* the returned value.</li> |
324 |
|
* </ul> |
325 |
|
* <p> |
326 |
|
* This method is used for matching against all parts of the URI |
327 |
|
* that may be either undefined or empty (i.e. all those but the |
328 |
|
* scheme-specific part and the path). In each case, the preceding |
329 |
|
* group is the content of the original group, along with some |
330 |
|
* additional distinguishing feature. For example, the preceding |
331 |
|
* group for the query includes the preceding question mark, |
332 |
|
* while that of the fragment includes the hash symbol. The presence |
333 |
|
* of these features enables disambiguation between the two cases |
334 |
|
* of a completely unspecified value and a simple non-existant value. |
335 |
|
* The scheme differs in that it will never return an empty string; |
336 |
|
* the delimiter follows the scheme rather than preceding it, so |
337 |
|
* it becomes part of the following section. The same is true |
338 |
|
* of the user information. |
339 |
|
* </p> |
340 |
|
* |
341 |
|
* @param match the matcher, which contains the results of the URI |
342 |
|
* matched against the URI regular expression. |
343 |
|
* @return either the matched content, <code>null</code> for undefined |
344 |
|
* values, or an empty string for a URI part with empty content. |
345 |
|
*/ |
346 |
private static String getURIGroup(Matcher match, int group) |
private static String getURIGroup(Matcher match, int group) |
347 |
{ |
{ |
348 |
String matched = match.group(group); |
String matched = match.group(group); |
349 |
return matched.length() == 0 ? null : matched; |
return matched.length() == 0 |
350 |
|
? ((match.group(group - 1).length() == 0) ? null : "") : matched; |
351 |
} |
} |
352 |
|
|
353 |
/** |
/** |
931 |
|
|
932 |
/** |
/** |
933 |
* <p> |
* <p> |
934 |
* Relativizes the given URI against this URI using the following |
* Relativizes the given URI against this URI. The following |
935 |
* algorithm: |
* algorithm is used: |
936 |
* </p> |
* </p> |
937 |
* <ul> |
* <ul> |
938 |
* <li>If either URI is opaque, the given URI is returned.</li> |
* <li>If either URI is opaque, the given URI is returned.</li> |