public static HttpUrl parse(String endpoint) {
		try {
			final URL url = new URL(endpoint);
			final String protocol = url.getProtocol();
			final String host = url.getHost();
			final int port = url.getPort();
			final String path = url.getPath();
			return new Builder()
				.withScheme(protocol)
				.withHost(host)
				.withPort(port >= 0 ? port : url.getDefaultPort())
				.withPath(path)
				.build();
		}
		catch (MalformedURLException ex) {
			throw new IllegalArgumentException(ex);
		}
	}
public static HttpUrl parse(String endpoint) {
		try {
			final URL url = new URL(endpoint);
			final String protocol = url.getProtocol();
			final String host = url.getHost();
			final int port = url.getPort();
			final String path = url.getPath();
			return new Builder()
				.withScheme(protocol)
				.withHost(host)
				.withPort(port >= 0 ? port : url.getDefaultPort())
				.withPath(path)
				.build();
		}
		catch (MalformedURLException ex) {
			throw new IllegalArgumentException(ex);
		}
	}
public static HttpUrl parse ( String endpoint ) { try { final URL url = new URL ( endpoint ) ; final String protocol = url . getProtocol ( ) ; final String host = url . getHost ( ) ; final int port = url . getPort ( ) ; final String path = url . getPath ( ) ; return new Builder ( ) . withScheme ( protocol ) . withHost ( host ) . withPort ( port >= 0 ? port : url . getDefaultPort ( ) ) . withPath ( path ) . build ( ) ; } catch ( MalformedURLException ex ) { throw new IllegalArgumentException ( ex ) ; } }
Parse URL string to create new {@link HttpUrl} instance.

@param endpoint URL value.
@return The final {@link HttpUrl} instance.
@throws IllegalArgumentException If URL is malformed.
Parse URL string to create new { @link HttpUrl } instance .