@Override public String decode(String encodedValue) { return URL.decode(encodedValue); }
String urlDecode(String value) { return URL.decode(value); } }
@Override public String decode(String encodedURL) { return URL.decode(encodedURL); }
/** * Decodes a given string using the standard URI encoding mechanism and the * UTF-8 character set. * * @param toDecode * The string to decode. * @return The decoded string. */ public static String decode(String toDecode) { String result = null; try { result = URL.decode(toDecode); } catch (NullPointerException npe) { System.err .println("Unable to decode the string with the UTF-8 character set."); } return result; }
private String parseUserInfo(String uri) { // Extract username:password int pathDivider = uri.indexOf('/'); int pos = uri.lastIndexOf('@', pathDivider > -1 ? pathDivider : uri.length() - 1); // authority@ must come before /path if (pos > -1 && (pathDivider == -1 || pos < pathDivider)) { String[] t = uri.substring(0, pos).split(":"); user = !t[0].isEmpty() ? URL.decode(t[0]) : null; password = t.length > 1 && !t[1].isEmpty() ? URL.decode(t[1]) : null; uri = uri.substring(pos + 1); } else { user = null; password = null; } return uri; }
private static String decode(final Path path) { return URL.decode(path.toURI()); } }
private static String decode(final Path path) { return URL.decode(path.toURI()); } }
@Override public void prepareFromRequest(PlaceRequest request) { super.prepareFromRequest(request); _componentName = request.getParameter(NameTokens.COMPONENT_NAME_PARAM, null); if (_componentName != null) { _componentName = URL.decode(_componentName); } _extensionName = request.getParameter(NameTokens.EXTENSION_NAME_PARAM, null); if (_extensionName != null) { _extensionName = URL.decode(_extensionName); } }
/** * Decodes a given string using the standard URI encoding mechanism. If the * provided character set is null, the string is returned but not decoded. * <em><strong>Note:</strong> The <a * href="http://www.w3.org/TR/html40/appendix/notes.html#non-ascii-chars"> * World Wide Web Consortium Recommendation</a> states that UTF-8 should be * used. Not doing so may introduce incompatibilites.</em> * * @param toDecode * The string to decode. * @param characterSet * The name of a supported character encoding. * @return The decoded string or null if the named character encoding is not * supported. */ public static String decode(String toDecode, CharacterSet characterSet) { if (!CharacterSet.UTF_8.equals(characterSet)) { throw new IllegalArgumentException( "Only UTF-8 URL encoding is supported under GWT"); } String result = null; try { result = (characterSet == null) ? toDecode : URL.decode(toDecode); } catch (NullPointerException npe) { System.err .println("Unable to decode the string with the UTF-8 character set."); } return result; }
@Override public void prepareFromRequest(PlaceRequest request) { super.prepareFromRequest(request); _applicationName = request.getParameter(NameTokens.APPLICATION_NAME_PARAM, null); if (_applicationName != null) { _applicationName = URL.decode(_applicationName); } }
@Override public void prepareFromRequest(PlaceRequest request) { super.prepareFromRequest(request); _artifactKey = request.getParameter(NameTokens.ARTIFACT_REFERENCE_KEY_PARAM, null); if (_artifactKey != null) { _artifactKey = URL.decode(_artifactKey); } }
@Override public void prepareFromRequest(PlaceRequest request) { super.prepareFromRequest(request); _serviceName = _placeManager.getCurrentPlaceRequest().getParameter(NameTokens.SERVICE_NAME_PARAM, null); _applicationName = _placeManager.getCurrentPlaceRequest().getParameter(NameTokens.APPLICATION_NAME_PARAM, null); if (_serviceName != null) { _serviceName = URL.decode(_serviceName); } if (_applicationName != null) { _applicationName = URL.decode(_applicationName); } }
@Override public void prepareFromRequest(PlaceRequest request) { super.prepareFromRequest(request); _referenceName = _placeManager.getCurrentPlaceRequest().getParameter(NameTokens.REFERENCE_NAME_PARAM, null); _applicationName = _placeManager.getCurrentPlaceRequest().getParameter(NameTokens.APPLICATION_NAME_PARAM, null); if (_referenceName != null) { _referenceName = URL.decode(_referenceName); } if (_applicationName != null) { _applicationName = URL.decode(_applicationName); } }
if (pos > -1) { fragment = parsedUri.length() - pos == 1 ? null : URL.decode(parsedUri.substring(pos + 1)); if (!segment.isEmpty()) { String[] matrixParts = segment.split(";"); final String parsedSegment = URL.decode(matrixParts[0]); parsedSegments.add(parsedSegment); if (matrixParts.length > 1) { String[] matrixElements = matrixParts[i].split("="); if (matrixElements.length == 1) { buckets.add(URL.decode(matrixElements[0]), null); } else { buckets.add(URL.decode(matrixElements[0]), URL.decode(matrixElements[1]));
public ProjectViewPlace getPlace(String token) { GWT.log("[ProjectViewPlaceTokenizer] Parsing: " + token); token = URL.decode(token); GWT.log("[ProjectViewPlaceTokenizer] Decoded: " + token); MatchResult result = regExp.exec(token); GWT.log("[ProjectViewPlaceTokenizer] MatchResult: " + result); String projectId = result.getGroup(1); String perspectiveId = result.getGroup(2); String selectionString = result.getGroup(4); GWT.log("[ProjectViewPlaceTokenizer] Parsed: ProjectId: " + projectId); GWT.log("[ProjectViewPlaceTokenizer] Parsed: PerspectiveId: " + perspectiveId); GWT.log("[ProjectViewPlaceTokenizer] Parsed: Selection: " + selectionString); ProjectViewPlace.Builder builder = new ProjectViewPlace.Builder(ProjectId.get(projectId), PerspectiveId.get(perspectiveId)); if(selectionString != null) { ItemTokenizer tokenizer = new ItemTokenizer(); List<ItemToken> tokenList = tokenizer.parseTokens(selectionString); for(ItemToken t : tokenList) { OWLDataFactoryImpl dataFactory = new OWLDataFactoryImpl(); ItemTokenParser parser = new ItemTokenParser(); DefaultPrefixManager prefixManager = new DefaultPrefixManager(); prefixManager.setPrefix("owl:", Namespaces.OWL.getPrefixIRI()); List<Item<?>> entity = parser.parse(t, new DefaultItemTypeMapper(dataFactory, prefixManager)); for(Item<?> item : entity) { builder.withSelectedItem(item); } } } return builder.build(); }
public static void finishStartup() { try { String currentUrl = URL.decode(Window.Location.getHref()); if (hasQueryString(currentUrl) && !isGwtHostedModeParameterOnly()) { String[] services = getDecodedParameters(SERVICES);