Java Host Name Get getHost(String link)

Here you can find the source of getHost(String link)

Description

get Host

License

Open Source License

Declaration

public static String getHost(String link) 

Method Source Code


//package com.java2s;
import java.net.MalformedURLException;
import java.net.URL;

public class Main {
    public static String getHost(String link) {
        URL url;/*from w  ww. j  a  v  a 2s  .c om*/
        String host = "";
        try {
            url = new URL(link);
            host = url.getHost();
        } catch (MalformedURLException e) {
        }
        return host;
    }
}

Related

  1. getFullyQualifiedDomainName(String unqualifiedHostname)
  2. getFullyQualifiedHostName()
  3. getHost()
  4. getHost()
  5. getHost(String host)
  6. getHost(String s)
  7. getHostCore(final String quadGraph)
  8. getHostGateway()
  9. getHostInformation()