Author: rob.stryker(a)jboss.com
Date: 2012-05-25 06:07:23 -0400 (Fri, 25 May 2012)
New Revision: 41409
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/WebPortPoller.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServer.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerUtil.java
Log:
JBIDE-11626 to trunk / cr1
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/WebPortPoller.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/WebPortPoller.java 2012-05-25
09:51:28 UTC (rev 41408)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/WebPortPoller.java 2012-05-25
10:07:23 UTC (rev 41409)
@@ -30,6 +30,7 @@
import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
import org.jboss.ide.eclipse.as.core.server.internal.ServerStatePollerType;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
+import org.jboss.ide.eclipse.as.core.util.ServerUtil;
public class WebPortPoller implements IServerStatePoller2 {
@@ -73,7 +74,10 @@
}
private static String getURL(IServer server) {
- String url = "http://"+server.getHost(); //$NON-NLS-1$
+ String host = server.getHost();
+ // v6_safe
+ String host2 = ServerUtil.formatPossibleIpv6Address(server.getHost());
+ String url = "http://"+host2; //$NON-NLS-1$
JBossServer jbs = ServerConverter.getJBossServer(server);
int port = jbs.getJBossWebPort();
url += ":" + port; //$NON-NLS-1$
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServer.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServer.java 2012-05-25
09:51:28 UTC (rev 41408)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServer.java 2012-05-25
10:07:23 UTC (rev 41409)
@@ -201,9 +201,10 @@
return null;
IWebModule webModule =(IWebModule)module.loadAdapter(IWebModule.class,null);
- String url = host;
+ String host2 = ServerUtil.formatPossibleIpv6Address(host);
+ String url = host2;
if( !url.startsWith("http://") &&
!url.startsWith("https://") ) { //$NON-NLS-1$ //$NON-NLS-2$
- url = "http://"+host; //$NON-NLS-1$
+ url = "http://"+host2; //$NON-NLS-1$
}
if (port != 80)
url += ":" + port; //$NON-NLS-1$
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerUtil.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerUtil.java 2012-05-25
09:51:28 UTC (rev 41408)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerUtil.java 2012-05-25
10:07:23 UTC (rev 41409)
@@ -220,5 +220,16 @@
String encoded = URLEncoder.encode(secureKey, "UTF-8"); //$NON-NLS-1$
return root.node(encoded);
}
-
+ public static String formatPossibleIpv6Address(String address) {
+ if (address == null) {
+ return address;
+ }
+ if (!address.contains(":")) { //$NON-NLS-1$
+ return address;
+ }
+ if (address.startsWith("[") &&
address.endsWith("]")) { //$NON-NLS-1$ //$NON-NLS-2$
+ return address;
+ }
+ return "[" + address + "]"; //$NON-NLS-1$//$NON-NLS-2$
+ }
}
Show replies by date