Exemplo n.º 1
0
 // Strip off everything unneeded
 private String getBaseUrl(String pUrl, String pServletPath) {
   String sUrl;
   try {
     URL url = new URL(pUrl);
     String host = getIpIfPossible(url.getHost());
     sUrl = new URL(url.getProtocol(), host, url.getPort(), pServletPath).toExternalForm();
   } catch (MalformedURLException exp) {
     sUrl = plainReplacement(pUrl, pServletPath);
   }
   return sUrl;
 }
Exemplo n.º 2
0
 String srvUrlStem(String host) {
   if (host == null) {
     return null;
   }
   StringBuilder sb = new StringBuilder();
   sb.append(reqURL.getProtocol());
   sb.append("://");
   sb.append(host);
   sb.append(':');
   sb.append(reqURL.getPort());
   return sb.toString();
 }
Exemplo n.º 3
0
 String srvURL(PeerIdentity peer, ServletDescr d, String params) {
   return srvURLFromStem(peer.getUiUrlStem(reqURL.getPort()), d, params);
 }