code: public static InetSocketAddress createSocketAddr(String target, int defaultPort) {
  		int colonIndex = target.indexOf(':');
  		if (colonIndex < 0 && defaultPort == -1) {
  			throw new RuntimeException("Not a host:port pair: " + target);
  		}
  		String hostname = "";
  		int port = -1;
  		if (!target.contains("/")) {
  			if (colonIndex == -1) {
  				hostname = target;
  			} else {
  				// must be the old style <host>:<port>
  				hostname = target.substring(0, colonIndex);
  				port = Integer.parseInt(target.substring(colonIndex + 1));
  			}
  		} else {
  			// a new uri
  			try {
  				URI addr = new URI(target);
  				hostname = addr.getHost();
  				port = addr.getPort();
  			} catch (URISyntaxException use) {
  				LOG.fatal(use);
  			}
  		}
  
  		if (port == -1) {
  			port = defaultPort;
  		}
  
  		if (getStaticResolution(hostname) != null) {
  			hostname = getStaticResolution(hostname);
  		}
  		return new InetSocketAddress(hostname, port);
  	}
docs: Util method to build socket addr from either:
  <host>
  <host>:<post>
  <fs>://<host>:<port>/<path>