List of usage examples for com.google.gwt.http.client URL decodeQueryString
public static String decodeQueryString(String encodedURLComponent)
From source file:org.geosdi.geoplatform.gui.client.configuration.getmap.choise.encoder.GetMapUrlEncoder.java
License:Open Source License
@Override public String decodeQueryString(String url) { return this.urlEncoding = URL.decodeQueryString(url); }
From source file:org.geosdi.geoplatform.gui.client.widget.form.LoadKmlFromUrlWidget.java
License:Open Source License
private boolean checkUrl() { boolean check = false; suggestion = null;// w ww . j a v a2 s. c om String url = urlText.getValue(); // System.out.println("*** URL:\n" + url + "\n"); if (url == null) { // If it is added the listener on Events.OnPaste, sometimes url is NULL System.out.println("URL is NULL"); return check; } url = url.replaceAll("[ ]+", ""); // Delete all spaces urlEncoding = URL.decodeQueryString(url); // Encoding into ASCII System.out.println("*** URL encoding:\n" + GPRegEx.printPrettyURL(urlEncoding)); if (!urlEncoding.startsWith("http://")) { suggestion = KMLErrorMessageConstants.INSTANCE.suggestionURLStartText(); } else if (GPRegEx.RE_FUSION_TABLES_URL.test(urlEncoding)) { // URL Fusion Tables if (!GPRegEx.RE_FUSION_TABLES_QS_QUERY.test(urlEncoding)) { suggestion = KMLErrorMessageConstants.INSTANCE.suggestionCheckFieldQueryText(); } else if (!GPRegEx.RE_FUSION_TABLES_QS_O.test(urlEncoding)) { suggestion = KMLErrorMessageConstants.INSTANCE.suggestionCheckFieldOText(); } else if (!GPRegEx.RE_FUSION_TABLES_QS_G.test(urlEncoding)) { suggestion = KMLErrorMessageConstants.INSTANCE.suggestionCheckFieldGText(); } } else if (!urlEncoding.toUpperCase().endsWith(GPExtensions.KML.toString())) { // URL direct KML suggestion = KMLErrorMessageConstants.INSTANCE.suggestionURLMustReferKMLText(); } if (suggestion == null) { // No suggestion -> NO syntax error check = true; suggestion = KMLErrorMessageConstants.INSTANCE.suggestionURLOKText(); } System.out.println("*** Suggestion = " + suggestion + "\n### ### ###"); return check; }
From source file:org.geosdi.geoplatform.gui.client.widget.GPKmlWidget.java
License:Open Source License
private boolean checkUrl() { boolean check = false; suggestion = null;/* ww w. j av a2s. c o m*/ String url = urlText.getValue(); // System.out.println("*** URL:\n" + url + "\n"); if (url == null) { // If it is added the listener on Events.OnPaste, sometimes url is NULL System.out.println("URL is NULL"); return check; } url = url.replaceAll("[ ]+", ""); // Delete all spaces urlEncoding = URL.decodeQueryString(url); // Encoding into ASCII // System.out.println("*** URL encoding:\n" + GPRegEx.printPrettyURL(urlEncoding)); if (!urlEncoding.startsWith("http://")) { suggestion = KMLErrorMessageConstants.INSTANCE.suggestionURLStartText(); } else if (GPRegEx.RE_FUSION_TABLES_URL.test(urlEncoding)) { // URL Fusion Tables if (!GPRegEx.RE_FUSION_TABLES_QS_QUERY.test(urlEncoding)) { suggestion = KMLErrorMessageConstants.INSTANCE.suggestionCheckFieldQueryText(); } else if (!GPRegEx.RE_FUSION_TABLES_QS_O.test(urlEncoding)) { suggestion = KMLErrorMessageConstants.INSTANCE.suggestionCheckFieldOText(); } else if (!GPRegEx.RE_FUSION_TABLES_QS_G.test(urlEncoding)) { suggestion = KMLErrorMessageConstants.INSTANCE.suggestionCheckFieldGText(); } } else if (!urlEncoding.toLowerCase().endsWith(".kml")) { // URL direct KML suggestion = KMLErrorMessageConstants.INSTANCE.suggestionURLMustReferKMLText(); } if (suggestion == null) { // No suggestion -> NO syntax error check = true; suggestion = KMLErrorMessageConstants.INSTANCE.suggestionURLOKText(); ; } // System.out.println("*** Suggestion = " + suggestion + "\n### ### ###"); return check; }
From source file:org.gwtwidgets.client.stream.HtmlStreamReader.java
License:Apache License
private Message decodeMessage(Element e) { Message message = new Message(); String content = e.getInnerText(); String[] parts = content.split(","); message.setContent(URL.decodeQueryString(parts[0])); for (int i = 1; i < parts.length; i++) { String[] keyValuePair = parts[i].split("="); message.getAttributes().put(URL.decodeQueryString(keyValuePair[0]), URL.decodeQueryString(keyValuePair[1])); }/*from w w w. j av a 2s . com*/ message.setSerialNumber(Integer.parseInt(e.getAttribute("id"))); return message; }
From source file:org.jboss.wise.gwt.client.Main.java
License:Open Source License
public void onModuleLoad() { MainServiceAsync rpcService = GWT.create(MainService.class); HandlerManager eventBus = new HandlerManager(null); AppController appViewer = new AppController(rpcService, eventBus); //rootLogger.log(Level.INFO, "Main: href: " + Window.Location.getHref()); //rootLogger.log(Level.INFO, "Main: queryString: " + Window.Location.getQueryString()); String hRef = Window.Location.getHref(); String qStr = Window.Location.getQueryString(); if (qStr != null && qStr.length() > 0) { int indx = hRef.indexOf(qStr); if (indx > 0) { // extract and send the URL's query parameter to the start page String wsdlParam = Window.Location.getParameter("wsdl"); if (wsdlParam != null) { String decodedWsdl = URL.decodeQueryString(wsdlParam); eventBus.fireEvent(new InputWsdlEvent(decodedWsdl)); }//from w ww. j ava 2s .c o m } } appViewer.go(RootPanel.get()); }
From source file:org.jbpm.designer.client.shared.AssignmentData.java
License:Apache License
protected String urlDecodeConstant(String s) { if (s == null || s.isEmpty()) { return s; } return URL.decodeQueryString(s); }
From source file:org.jbpm.designer.client.shared.util.StringUtils.java
License:Apache License
/** * URLDecode a string//from www . ja va 2 s .com * @param s * @return */ public static String urlDecode(String s) { if (s == null || s.isEmpty()) { return s; } return URL.decodeQueryString(s); }
From source file:org.kaaproject.kaa.server.admin.client.mvp.place.PlaceParams.java
License:Apache License
public static void paramsFromToken(String token) { paramsMap.clear();//from ww w .ja v a 2 s.co m if (token != null && token.trim().length() > 0) { String[] params = token.split(PARAMS_SEPARATOR); for (String param : params) { String[] keyVal = param.split("="); if (keyVal != null && keyVal.length == 2) { paramsMap.put(keyVal[0], URL.decodeQueryString(keyVal[1])); } } } }
From source file:org.kaaproject.kaa.server.admin.shared.util.UrlParams.java
License:Apache License
public static void updateParamsFromUrl(Map<String, String> paramsMap, String paramsUrl) { if (paramsUrl != null && paramsUrl.trim().length() > 0) { String[] params = paramsUrl.split(PARAMS_SEPARATOR); for (String param : params) { String[] keyVal = param.split("="); if (keyVal != null && keyVal.length == 2) { paramsMap.put(keyVal[0], URL.decodeQueryString(keyVal[1])); }/*from ww w . j av a 2 s. com*/ } } }
From source file:org.obiba.opal.web.gwt.app.client.magma.presenter.SummaryTabPresenter.java
License:Open Source License
@Override public void onRefreshSummary() { cancelPendingSummaryRequest();/*from www . j ava2 s. co m*/ String uri = resourceRequestBuilder.getResource(); // Remove queries from the url if (uri.contains("?")) { uri = uri.substring(0, uri.indexOf("?")); } // We have to decode the uri only because we rebuild a uri through uribuilder to truncate query paramaters // and add new ones... Ideally, we would have access to the UriBuilder directly. UriBuilder uriBuilder = UriBuilder.create().fromPath(URL.decodeQueryString(uri)); uriBuilder.query("resetCache", "true"); limit = Math.max(getView().getLimit().intValue(), Math.min(MIN_LIMIT, entitiesCount)); if (limit < entitiesCount) { uriBuilder.query("limit", String.valueOf(limit)); } String target = uriBuilder.build(); resourceRequestBuilder.forResource(target); if (target.contains("_transient")) { //for script evaluation, we must use post so the script/categories are passed in the form, otherwise the summary is incorrect resourceRequestBuilder.post(); } else { resourceRequestBuilder.get(); } onReset(); }