标签:
private String getDomain(String destination){ if(destination==null||destination.trim().equals("")){ return ""; } String domain = ""; URL url =null; try { url= new URL(destination); domain =url.getProtocol()+"://"+url.getHost(); } catch (MalformedURLException e) { LOG.info("url=["+destination+"] not correct! ");; } return domain; }
标签:
原文地址:http://www.cnblogs.com/davidwang456/p/4650275.html