Here you can find the source of convertUrlToHostNameAsNodeName(String url)
public static String convertUrlToHostNameAsNodeName(String url) throws MalformedURLException
//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*/ }