code: public static URL getCorrectHostnamePort(String hostPort) {
  		try {
  			URL u = new URL("http://" + hostPort);
  			if (u.getHost() == null) {
  				throw new IllegalArgumentException("The given host:port ('" + hostPort + "') doesn't contain a valid host");
  			}
  			if (u.getPort() == -1) {
  				throw new IllegalArgumentException("The given host:port ('" + hostPort + "') doesn't contain a valid port");
  			}
  			return u;
  		} catch (MalformedURLException e) {
  			throw new IllegalArgumentException("The given host:port ('" + hostPort + "') is invalid", e);
  		}
  	}
docs: Method to validate if the given String represents a hostname:port.
  
  <p>Works also for ipv6.
  
  <p>See: http://stackoverflow.com/questions/2345063/java-common-way-to-validate-and-convert-hostport-to-inetsocketaddress
  
  @return URL object for accessing host and Port