|
|
|
@ -6,12 +6,15 @@ import com.fr.stable.FCloneable;
|
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
import java.net.URI; |
|
|
|
|
import java.net.URISyntaxException; |
|
|
|
|
|
|
|
|
|
import com.fr.third.guava.base.Strings; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @author yaohwu |
|
|
|
|
*/ |
|
|
|
|
public class RemoteWorkspaceURL implements FCloneable { |
|
|
|
|
private static final String IPV6_JUDGE_SYMBOL = "["; |
|
|
|
|
|
|
|
|
|
private static final String IPV6_JUDGE_SYMBOL2 = "]"; |
|
|
|
|
|
|
|
|
|
public static final String SYSTEM_LOGIN_PATH = "#management/system/login"; |
|
|
|
|
|
|
|
|
@ -102,6 +105,7 @@ public class RemoteWorkspaceURL implements FCloneable {
|
|
|
|
|
parserWebAndServlet(lefts); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
this.refreshIPV6Format(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public boolean hasDefaultHostName() { |
|
|
|
@ -139,12 +143,18 @@ public class RemoteWorkspaceURL implements FCloneable {
|
|
|
|
|
*/ |
|
|
|
|
public void refreshIPV6Format() { |
|
|
|
|
String url = this.url; |
|
|
|
|
if (Strings.isNullOrEmpty(url)) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (!url.contains(IPV6_JUDGE_SYMBOL) || !url.contains(IPV6_JUDGE_SYMBOL2)) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
try { |
|
|
|
|
URI uri = new URI(url); |
|
|
|
|
this.host = uri.getHost(); |
|
|
|
|
this.port = String.valueOf(uri.getPort()); |
|
|
|
|
} catch (URISyntaxException e) { |
|
|
|
|
FineLoggerFactory.getLogger().info("error request url"); |
|
|
|
|
FineLoggerFactory.getLogger().info("error request url format"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -249,4 +259,7 @@ public class RemoteWorkspaceURL implements FCloneable {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
|
|
System.out.println("".contains("/")); |
|
|
|
|
} |
|
|
|
|
} |