JavaでSSL通信かどうか判断する方法

Javaコード:
private String getDomainName(String url){
if(url.startsWith(“http://”)){
url=url.substring(7);
}else if(url.startsWith(“https://”)){
url = url.substring(8);
}
String result = url.split(“/”)[0];
return result;
}

Comments are closed.