Java URL to convertUrlToHostNameAsNodeName(String url)

Here you can find the source of convertUrlToHostNameAsNodeName(String url)

Description

convert Url To Host Name As Node Name

License

Apache License

Declaration

public static String convertUrlToHostNameAsNodeName(String url) throws MalformedURLException 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.net.MalformedURLException;
import java.net.URL;

public class Main {
    public static String convertUrlToHostNameAsNodeName(String url) throws MalformedURLException {
        String host = new URL(url).getHost().replace('.', '-');
        return host;
    }/*from  ww  w.ja v a 2 s .  c om*/
}

Related

  1. convertURL(String url)
  2. convertURLToFile(URL url)
  3. convertUrlToFilename(URL url)
  4. convertUrlToFilePath(URL url)
  5. convertUrlToMp3Cmd(final String url)
  6. convertURIToURL(URI uri)
  7. copyUrlToFile(URL url, File file)
  8. copyUrlToFile(URL url, File file)