Beispiel #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;
 }
 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();
 }
 String srvURL(PeerIdentity peer, ServletDescr d, String params) {
   return srvURLFromStem(peer.getUiUrlStem(reqURL.getPort()), d, params);
 }