515 |
sb.append(":"); |
sb.append(":"); |
516 |
} |
} |
517 |
|
|
518 |
if (authority.length() != 0) |
// If we have superfluous leading slashes (that means, at least 2) |
519 |
{ |
// we always add the authority component ("//" + host) to |
520 |
sb.append("//").append(authority); |
// avoid ambiguity. Otherwise we would generate an URL like |
521 |
} |
// proto://home/foo |
522 |
|
// where we meant: |
523 |
sb.append(file); |
// host: <empty> - file: //home/foo |
524 |
|
// but URL spec says it is: |
525 |
|
// host: home - file: /foo |
526 |
|
if (authority.length() != 0 || file.startsWith("//") ) |
527 |
|
sb.append("//").append(authority).append(file); |
528 |
|
else |
529 |
|
sb.append(file); |
530 |
|
|
531 |
if (ref != null) |
if (ref != null) |
532 |
sb.append('#').append(ref); |
sb.append('#').append(ref); |