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; }
时间: 2024-10-29 19:12:02