(String rawHost)
| 117 | } |
| 118 | |
| 119 | private static URI createHttpUri(String rawHost) { |
| 120 | int slashIndex = rawHost.indexOf('/'); |
| 121 | String host = slashIndex == -1 ? rawHost : rawHost.substring(0, slashIndex); |
| 122 | String path = slashIndex == -1 ? null : rawHost.substring(slashIndex); |
| 123 | |
| 124 | try { |
| 125 | return new URI("http", host, path, null); |
| 126 | } catch (URISyntaxException e) { |
| 127 | throw new UncheckedIOException(new IOException(e)); |
| 128 | } |
| 129 | } |
| 130 | } |