MCPcopy Create free account
hub / github.com/davidgiven/luje / getHashString

Method getHashString

lib/java/net/URI.java:1670–1710  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1668 * and converts escaped octets to lowercase.
1669 */
1670 private String getHashString() {
1671 StringBuilder result = new StringBuilder();
1672 if (scheme != null) {
1673 result.append(scheme.toLowerCase());
1674 result.append(':');
1675 }
1676 if (opaque) {
1677 result.append(schemespecificpart);
1678 } else {
1679 if (authority != null) {
1680 result.append("//"); //$NON-NLS-1$
1681 if (host == null) {
1682 result.append(authority);
1683 } else {
1684 if (userinfo != null) {
1685 result.append(userinfo + "@"); //$NON-NLS-1$
1686 }
1687 result.append(host.toLowerCase());
1688 if (port != -1) {
1689 result.append(":" + port); //$NON-NLS-1$
1690 }
1691 }
1692 }
1693
1694 if (path != null) {
1695 result.append(path);
1696 }
1697
1698 if (query != null) {
1699 result.append('?');
1700 result.append(query);
1701 }
1702 }
1703
1704 if (fragment != null) {
1705 result.append('#');
1706 result.append(fragment);
1707 }
1708
1709 return convertHexToLowerCase(result.toString());
1710 }
1711
1712 /**
1713 * Converts this URI instance to a URL.

Callers 1

hashCodeMethod · 0.95

Calls 4

appendMethod · 0.95
convertHexToLowerCaseMethod · 0.95
toStringMethod · 0.95
toLowerCaseMethod · 0.45

Tested by

no test coverage detected