public static @CheckForNull String getActionUrl(String itUrl, Action action) {
        String urlName = action.getUrlName();
        if (urlName == null)   return null;    // Should not be displayed
        try {
            if (new URI(urlName).isAbsolute()) {
                return urlName;
            }
        } catch (URISyntaxException x) {
            Logger.getLogger(Functions.class.getName()).log(Level.WARNING, "Failed to parse URL for {0}: {1}", new Object[] {action, x});
            return null;
        }
        if (urlName.startsWith("/"))
            return joinPath(Stapler.getCurrentRequest().getContextPath(), urlName);
        else
            // relative URL name
            return joinPath(Stapler.getCurrentRequest().getContextPath() + '/' + itUrl, urlName);
    }
@Test
    public void testGetActionUrl_absoluteUriWithAuthority() {
        String[] uris = {
            "http://example.com/foo/bar",
            "https://example.com/foo/bar",
            "ftp://example.com/foo/bar",
            "svn+ssh://nobody@example.com/foo/bar",
        };
        for (String uri : uris) {
            String result = Functions.getActionUrl(null, createMockAction(uri));
            assertEquals(uri, result);
        }
    }