public Uri getDestination() { return Uri.parse(element.getAttribute("href")); }
public FileDownloadInfo deserializeColonNotation(final String colonNotation) { final String[] parts = colonNotation.split(SEPARATOR, COLON_NOTATION_PART_COUNT); if (parts.length != COLON_NOTATION_PART_COUNT) { final String message = String.format( "%s should contain %d parts separated by '%s'", colonNotation, COLON_NOTATION_PART_COUNT, SEPARATOR ); throw new IllegalArgumentException(message); } final MediaType mediaType = MediaType.valueOf(parts[0]); final String fileName = parts[1]; final Uri downloadUri = Uri.parse(parts[2]); return new FileDownloadInfo(mediaType, fileName, downloadUri); } }
private String getFullUrl(RemotablePluginAccessor remotablePluginAccessor, String appRelativeUrl, Map<String, String[]> params) { Uri targetUrl = Uri.parse(appRelativeUrl); return remotablePluginAccessor.createGetUrl(targetUrl.toJavaUri(), params); } }
private String getFullUrl(RemotablePluginAccessor remotablePluginAccessor, String appRelativeUrl, Map<String, String[]> params) { Uri targetUrl = Uri.parse(appRelativeUrl); return remotablePluginAccessor.createGetUrl(targetUrl.toJavaUri(), params); } }
@Override public InitializedBuilder context(final ModuleContextParameters context) { String substitutedUrl = urlVariableSubstitutor.replace(templateUri, WebFragmentContext.from(context)); UriBuilder uriBuilder = new UriBuilder(Uri.parse(substitutedUrl)); return new InitializedBuilderImpl(addonKey, namespace, uriBuilder); }
@Override public InitializedBuilder context(final ModuleContextParameters context) { String substitutedUrl = urlVariableSubstitutor.replace(templateUri, WebFragmentContext.from(context)); UriBuilder uriBuilder = new UriBuilder(Uri.parse(substitutedUrl)); return new InitializedBuilderImpl(addonKey, namespace, uriBuilder); }
@VisibleForTesting URI getURI(String addonBaseUrl, String endpointRelativePath) { UriBuilder builder = new UriBuilder(Uri.parse(addonBaseUrl + endpointRelativePath)); UserProfile user = userManager.getRemoteUser(); if (null != user) { builder.addQueryParameter(USER_KEY, user.getUserKey().getStringValue()); } return builder.toUri().toJavaUri(); }
@VisibleForTesting URI getURI(String addonBaseUrl, String endpointRelativePath) { UriBuilder builder = new UriBuilder(Uri.parse(addonBaseUrl + endpointRelativePath)); UserProfile user = userManager.getRemoteUser(); if (null != user) { builder.addQueryParameter(USER_KEY, user.getUserKey().getStringValue()); } return builder.toUri().toJavaUri(); }