Returns the full announce URL served by this tracker.
<p>
<p>
This has the form http://host:port/announce.
</p>
17234
private static URL getDefaultAnnounceUrl(InetSocketAddress address) {
    try {
      return new URL("http",
              address.getAddress().getCanonicalHostName(),
              address.getPort(),
              ANNOUNCE_URL);
    } catch (MalformedURLException mue) {
      logger.error("Could not build tracker URL: {}!", mue, mue);
    }

    return null;
  }
1039463
public String getDisplayedUrl(String sitePath) {

        if (getSitemapEntry().isLeafType() && sitePath.endsWith("/")) {
            sitePath = sitePath.substring(0, sitePath.length() - 1);
        }
        CmsSitemapController controller = CmsSitemapView.getInstance().getController();
        String exportProp = controller.getEffectiveProperty(getSitemapEntry(), "export");
        if ("true".equals(exportProp)) {
            String exportName = getSitemapEntry().getExportName();
            if (exportName == null) {
                exportName = CmsCoreProvider.get().getSiteRoot();
            }
            String rfsPrefix = CmsSitemapView.getInstance().getController().getData().getExportRfsPrefix();
            if (rfsPrefix != null) {
                return CmsStringUtil.joinPaths(rfsPrefix, exportName, sitePath);
            }
        }
        return CmsCoreProvider.get().link(sitePath);
    }
620171
def announce_urls(self, default=[]):  # pylint: disable=dangerous-default-value
        
        try:
            response = self._engine._rpc.t.multicall(self._fields["hash"], 0, "t.url=", "t.is_enabled=")
        except xmlrpc.ERRORS as exc:
            raise error.EngineError("While getting announce URLs for #%s: %s" % (self._fields["hash"], exc))

        if response:
            return [i[0] for i in response if i[1]]
        else:
            return default
1027331
def show_announcement_view(request):
    
    if request.method == "POST":
        announcement_id = request.POST.get("announcement_id")
        if announcement_id:
            announcement = Announcement.objects.get(id=announcement_id)
            announcement.user_map.users_hidden.remove(request.user)
            announcement.user_map.save()
            return http.HttpResponse("Unhidden")
        raise http.Http404
    else:
        return http.HttpResponseNotAllowed(["POST"], "HTTP 405: METHOD NOT ALLOWED")
882454
private String getLegend() {

        switch (m_mode) {
            case sources:
                return org.opencms.gwt.client.Messages.get().key(
                    org.opencms.gwt.client.Messages.GUI_RESOURCE_INFO_TAB_USAGE_0);
            case targets:

                return org.opencms.gwt.client.Messages.get().key(
                    org.opencms.gwt.client.Messages.GUI_RESOURCE_INFO_TAB_TARGETS_0);
            case siblings:
            default:
                return org.opencms.gwt.client.Messages.get().key(
                    org.opencms.gwt.client.Messages.GUI_RESOURCE_INFO_TAB_SIBLINGS_0);

        }

    }
986915
@Override
    public String getCompleteURL() {
        ServletRESTRequestImpl ret = castRequest();
        if (ret != null)
            return ret.getCompleteURL();
        return null;
    }
219438
public String getPermalinkForCurrentPage(CmsObject cms) {

        return getPermalink(cms, cms.getRequestContext().getUri(), cms.getRequestContext().getDetailContentId());
    }
1148623
@Override
	public String getMessage() {
		if (getCause() instanceof UnknownHostException) {
			return "Host (" + getHost() + ") is unreachable !!!!";
		}
		if (getCause() instanceof ConnectException) {
			return "Host (" + getHost() + ") is unreachable at Port (" + getPort() + ")!!!!";
		}
		return getCause().getMessage();
	}
321959
public String getServerUrl() {
        if (StringUtils.hasText(this.serverUrl)) {
            return serverUrl;
        } else {
            return "service:jmx:" + protocol + ":///jndi/" + protocol + "://" + host + ":" + port + (binding != null ? "/" + binding : "");
        }
    }
271082
public String getRequestURL()
    {
    	HttpServletRequest httpReq = getRequest();
    	if (httpReq==null)
    		return null;
    	else
    		return httpReq.getRequestURL().toString();
    }
638833
public String getIssueTrackerUrl(){
        final CommunityConfig communityConfig = getConfig().getCommunityConfiguration();
        if(communityConfig == null){
            return null;
        }
        return communityConfig.getIssueTracker();
    }
145091
private String serverUrl() {
        if (context.containsKey(AgentBootstrapperArgs.SERVER_URL)) {
            return (String) context.get(AgentBootstrapperArgs.SERVER_URL);
        } else {
            return "http://" + context.get("hostname") + ":" + context.get("port") + "/go";
        }
    }
57007
public String getUrl() {
        String frontUrl = this.url;
        if (frontUrl != null && !frontUrl.isEmpty() && !frontUrl.endsWith("/")) {
            frontUrl += '/';
        }
        return frontUrl;
    }
922132
@Override
    public StringBuffer getRequestURL() {

        StringBuffer sb = new StringBuffer(getScheme());
        sb.append("://");
        // Note: following code required if IPv6 IP host does not contain brackets
        // String host = getTargetHost();
        // if (-1 != host.indexOf(":")) {
        // // wrap brackets around the IPv6 IP address
        // host = "[" + host + "]";
        // }
        // sb.append(host);
        sb.append(getTargetHost());
        sb.append(':');
        sb.append(getTargetPort());
        sb.append(getRequestURI());
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "getRequestURL() returning " + sb.toString());
        }
        return sb;
    }
520753
public static function getSiteUrl()
    {
        if (!self::hasServerVariable('HTTP_HOST')) {
            return null;
        }
        
        $protocol = (self::looksLikeHttps()) ? 'https' : 'http';
        $port = self::getServerVariable('SERVER_PORT', 80);
        
        list ($host) = explode(':', self::getServerVariable('HTTP_HOST'));
        
        if (!in_array($port, [
            80,
            443
        ]) || ($protocol != 'https' && $port == 443)) {
            $host .= ':' . $port;
        }
        
        $fullUrl = $protocol . '://' . $host . '/';
        if (USE_INDEX_FILE) {
            $fullUrl .= 'index.php/';
        }
        
        return $fullUrl;
    }
965347
public static String getRequestLink(String url) {

        if (CmsStringUtil.isEmpty(url)) {
            return null;
        }
        int pos = url.indexOf(URL_DELIMITER);
        if (pos >= 0) {
            return url.substring(0, pos);
        }
        return url;

    }
230502
private URL getUrl() {
        ClassLoader loader = null;
        try {
            loader = Thread.currentThread().getContextClassLoader();
        } catch (Exception e) {
            // do nothing
        }

        if (loader == null) {
            loader = ClassPathResource.class.getClassLoader();
        }

        URL url = loader.getResource(this.resourceName);
        if (url == null) {
            // try to check for mis-used starting slash
            // TODO: see TODO below
            if (this.resourceName.startsWith("/")) {
                url = loader.getResource(this.resourceName.replaceFirst("[\\\\/]", ""));
                if (url != null)
                    return url;
            } else {
                // try to add slash, to make clear it's not an issue
                // TODO: change this mechanic to actual path purifier
                url = loader.getResource("/" + this.resourceName);
                if (url != null)
                    return url;
            }
            throw new IllegalStateException("Resource '" + this.resourceName + "' cannot be found.");
        }
        return url;
    }