@Override public String call() throws Exception { return webResourceUrlProvider.getStaticResourcePrefix(com.atlassian.plugin.webresource.UrlMode.RELATIVE); } }).getOrNull();
@Override public String getStaticResourcePrefix(String resourceCounter) { return webResourceUrlProvider.getStaticResourcePrefix(resourceCounter, UrlMode.AUTO); } }
@Override public String getStaticResourcePrefix() { return webResourceUrlProvider.getStaticResourcePrefix(UrlMode.AUTO); }
/** * @return url prefix for resource, including base url. */ public String getResourceUrlPrefix(String hash, String version, boolean isAbsolute) { return urlProvider.getStaticResourcePrefix(hash, version, (isAbsolute ? UrlMode.ABSOLUTE : UrlMode.RELATIVE)) + "/" + AbstractFileServerServlet.SERVLET_PATH; }
@SuppressWarnings("unused") public String getStaticResourcePrefix() { return webResourceUrlProvider.getStaticResourcePrefix(UrlMode.ABSOLUTE); }
public String getAbsoluteLogoUrl() { String jiraLogo = getLogoUrl(); if (jiraLogo != null && !jiraLogo.startsWith("http://") && !jiraLogo.startsWith("https://")) { jiraLogo = ComponentAccessor.getComponent(WebResourceUrlProvider.class).getStaticResourcePrefix(UrlMode.AUTO) + jiraLogo; } return jiraLogo; }
public UserProfileLink(String username, I18NBean i18n) { super(username, i18n); this.profilePicture = userAccessor.getUserProfilePicture(user); this.staticResourceUrlPrefix = ((WebResourceUrlProvider) ContainerManager.getComponent("webResourceUrlProvider")).getStaticResourcePrefix(UrlMode.AUTO); }
@Override public Map<String, Object> getTemplateParams() { // NOTE: if adding a parameter here please update the doc online at // https://developer.atlassian.com/display/JIRADEV/Velocity+Context+for+Email+Templates final I18nHelper i18nHelper = beanFactory.getInstance(locale); final Map<String, Object> templateParams = Maps.newHashMap(); templateParams.put("i18n", i18nHelper); final OutlookDate formatter = new OutlookDate(locale); templateParams.put("dateformatter", formatter); final LookAndFeelBean landf = LookAndFeelBean.getInstance(applicationProperties); templateParams.put("lfbean", landf); templateParams.put("baseurl", applicationProperties.getString(APKeys.JIRA_BASEURL)); String jiraLogo = landf.getLogoUrl(); if (jiraLogo != null && !jiraLogo.startsWith("http://") && !jiraLogo.startsWith("https://")) { jiraLogo = resourceUrlProvider.getStaticResourcePrefix(UrlMode.ABSOLUTE) + jiraLogo; } templateParams.put("jiraLogoUrl", jiraLogo); return templateParams; } }
if (jiraLogo != null && !jiraLogo.startsWith("http://") && !jiraLogo.startsWith("https://")) jiraLogo = webResourceUrlProvider.getStaticResourcePrefix(UrlMode.AUTO) + jiraLogo;
ChangesetsDO changesets = new ChangesetsDO( jiraBaseUrl, webResourceUrlProvider.getStaticResourcePrefix(UrlMode.AUTO), repository.getInstance().getUrl(), repository.getName(),
private SimpleLink convertWebItemToSimpleLink(final WebItem item, boolean addIconCachingPrefix) { String iconUrl = item.getParams().get("iconUrl"); if (StringUtils.isNotBlank(iconUrl) && isRelativeUrl(iconUrl)) { if (addIconCachingPrefix) { final String staticResourcePrefix = webResourceUrlProvider.getStaticResourcePrefix(UrlMode.RELATIVE); iconUrl = staticResourcePrefix + iconUrl; } else { final String baseUrl = velocityRequestContextFactory.getJiraVelocityRequestContext().getBaseUrl(); if (!StringUtils.startsWith(iconUrl, baseUrl)) { iconUrl = baseUrl + iconUrl; } } } final Option<String> id = option(item.getId()); return new SimpleLinkImpl(id.getOrElse(item.getCompleteKey()), item.getLabel(), item.getTitle(), iconUrl, item.getStyleClass(), item.getParams(), item.getUrl(), item.getAccessKey(), item.getWeight()); }
@Override protected String create() { // This transform's only "variable" is the context path, and hence is not even variable since the // context path is already in the url path. Therefore we don't need to contribute anything additional // to the hash - this transform is a "constant" and other transformers / conditions don't apply to data // uri's or images. final String version = Config.getPluginVersionOrInstallTime(webResourceIntegration.getPluginAccessor().getPlugin(parameters.getPluginKey()), usePluginInstallTimeInsteadOfTheVersionForSnapshotPlugins); String resourcePrefix = PATH_SEPARATOR + AbstractFileServerServlet.SERVLET_PATH + PATH_SEPARATOR + AbstractFileServerServlet.RESOURCE_URL_PREFIX; String localRelativeUrl = webResourceUrlProvider.getStaticResourcePrefix(version, UrlMode.RELATIVE) + resourcePrefix + PATH_SEPARATOR + parameters.getPluginKey() + ":" + parameters.getModuleKey() + PATH_SEPARATOR; if (requestCdnUrl) { final CDNStrategy cdnStrategy = webResourceIntegration.getCDNStrategy(); if (cdnStrategy == null || !cdnStrategy.supportsCdn()) { // This will throw an exception if we have the CDN parameter in the URL, but // webResourceIntegration.getCdnStrategy() returns null. This situation will occur // if the cdn strategy is changed (eg via dark feature) between url-generation time and // resource-fetch time. In this situation, it is correct to throw an exception - the alternative // is to poison the CDN-side cache with a resource that has not been transformed to CDN. throw new CdnStrategyChangedException("CDN strategy has changed between url generation time and resource fetch time"); } return cdnResourceUrlTransformer.getResourceCdnPrefix(localRelativeUrl); } else { return localRelativeUrl; } } };