|
|
@ -129,6 +129,31 @@ public class RemoteWorkspaceURL implements FCloneable { |
|
|
|
return this.url; |
|
|
|
return this.url; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* IPV6地址格式不同,处理字符串的方式不同,需要处理的是port和host |
|
|
|
|
|
|
|
* 形如 http://[XXXX::XXXX:XXXX:XXXX:XXXX]:8080/webroot/decision
|
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public void refreshIPV6Format() { |
|
|
|
|
|
|
|
String url = this.url; |
|
|
|
|
|
|
|
// 第三次出现"/"的地方
|
|
|
|
|
|
|
|
int webIndex = url.indexOf("/", url.indexOf("://") + 3); |
|
|
|
|
|
|
|
int hostIndex = url.indexOf("["); |
|
|
|
|
|
|
|
int portIndex = url.indexOf("]"); |
|
|
|
|
|
|
|
isContainsRelatedIndex(webIndex, hostIndex, portIndex); |
|
|
|
|
|
|
|
this.host = url.substring(hostIndex, portIndex + 1); |
|
|
|
|
|
|
|
this.port = url.substring(portIndex + 2, webIndex); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param webIndex web指针 |
|
|
|
|
|
|
|
* @param hostIndex 主机指针 |
|
|
|
|
|
|
|
* @param portIndex 端口指针 |
|
|
|
|
|
|
|
* @return 三个指针是否都存在 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public boolean isContainsRelatedIndex(int webIndex, int hostIndex, int portIndex) { |
|
|
|
|
|
|
|
return webIndex != -1 && hostIndex != -1 && portIndex != -1; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setHttps(boolean https) { |
|
|
|
public void setHttps(boolean https) { |
|
|
|
isHttps = https; |
|
|
|
isHttps = https; |
|
|
|