392 |
// right after the "://". The second colon is for an optional port value |
// right after the "://". The second colon is for an optional port value |
393 |
// and implies that the host from the context is used if available. |
// and implies that the host from the context is used if available. |
394 |
int colon; |
int colon; |
395 |
|
int slash = spec.indexOf('/'); |
396 |
if ((colon = spec.indexOf("://", 1)) > 0 |
if ((colon = spec.indexOf("://", 1)) > 0 |
397 |
|
&& ((colon < slash || slash < 0)) |
398 |
&& ! spec.regionMatches(colon, "://:", 0, 4)) |
&& ! spec.regionMatches(colon, "://:", 0, 4)) |
399 |
context = null; |
context = null; |
400 |
|
|
|
int slash; |
|
401 |
if ((colon = spec.indexOf(':')) > 0 |
if ((colon = spec.indexOf(':')) > 0 |
402 |
&& (colon < (slash = spec.indexOf('/')) || slash < 0)) |
&& (colon < slash || slash < 0)) |
403 |
{ |
{ |
404 |
// Protocol specified in spec string. |
// Protocol specified in spec string. |
405 |
protocol = spec.substring(0, colon).toLowerCase(); |
protocol = spec.substring(0, colon).toLowerCase(); |
430 |
authority = context.authority; |
authority = context.authority; |
431 |
} |
} |
432 |
else // Protocol NOT specified in spec. and no context available. |
else // Protocol NOT specified in spec. and no context available. |
|
|
|
|
|
|
433 |
throw new MalformedURLException("Absolute URL required with null context"); |
throw new MalformedURLException("Absolute URL required with null context"); |
434 |
|
|
435 |
protocol = protocol.trim(); |
protocol = protocol.trim(); |
900 |
Class c = Class.forName(clsName, true, systemClassLoader); |
Class c = Class.forName(clsName, true, systemClassLoader); |
901 |
ph = (URLStreamHandler) c.newInstance(); |
ph = (URLStreamHandler) c.newInstance(); |
902 |
} |
} |
903 |
|
catch (ThreadDeath death) |
904 |
|
{ |
905 |
|
throw death; |
906 |
|
} |
907 |
catch (Throwable t) { /* ignored */ } |
catch (Throwable t) { /* ignored */ } |
908 |
} |
} |
909 |
while (ph == null && pkgPrefix.hasMoreTokens()); |
while (ph == null && pkgPrefix.hasMoreTokens()); |