Example usage for com.google.gwt.http.client URL decode

List of usage examples for com.google.gwt.http.client URL decode

Introduction

In this page you can find the example usage for com.google.gwt.http.client URL decode.

Prototype

public static String decode(String encodedURL) 

Source Link

Document

Returns a string where all URL escape sequences have been converted back to their original character representations.

Usage

From source file:org.pathvisio.wikipathways.client.AtlasMapper.java

License:Apache License

public void onModuleLoad() {
    History.addHistoryListener(this);

    DockPanel mainPanel = new DockPanel();
    mainPanel.addStyleName(STYLE_ROOT);/*from   w  w w .j a va 2s. c  o m*/

    //Main title
    Label title = new Label("WikiPathways-Atlas Mapper");
    title.addStyleName(STYLE_TITLE);
    mainPanel.add(title, DockPanel.NORTH);

    //Current state info
    infoPanel = new StateInfoPanel(this);
    mainPanel.add(infoPanel, DockPanel.NORTH);

    deckPanel = new DeckPanel();
    deckPanel.addStyleName(STYLE_CENTER);

    progressPanel = createProgressPanel();
    deckPanel.add(progressPanel);

    pathwayPanel = createPathwayPanel();
    deckPanel.add(pathwayPanel);

    factorPanel = createFactorPanel();
    deckPanel.add(factorPanel);

    imagePanel = createImagePanel();
    deckPanel.add(imagePanel);

    mainPanel.add(deckPanel, DockPanel.CENTER);
    RootPanel.get().add(mainPanel);

    deckPanel.showWidget(deckPanel.getWidgetIndex(pathwayPanel));

    //Process url parameters
    String text = Window.Location.getHash();
    if (text == null)
        text = "";
    if (text.startsWith("#"))
        text = text.substring(1);
    text = URL.decode(text);
    onHistoryChanged(text);
}

From source file:org.rebioma.client.ApplicationView.java

License:Apache License

public static Map<String, List<String>> getHistoryTokenParams(String historyToken) {
    Map<String, List<String>> out = new HashMap<String, List<String>>();
    if (historyToken != null && historyToken.length() > 0) {
        for (String kvPair : historyToken.split("&")) {
            String[] kv = kvPair.split("=", 2);
            if (kv[0].length() == 0) {
                continue;
            }//from w ww . java 2 s  .c o  m

            List<String> values = out.get(kv[0]);
            if (values == null) {
                values = new ArrayList<String>();
                out.put(kv[0], values);
            }
            values.add(kv.length > 1 ? URL.decode(kv[1]) : "");
        }
    }

    for (Map.Entry<String, List<String>> entry : out.entrySet()) {
        entry.setValue(Collections.unmodifiableList(entry.getValue()));
    }

    out = Collections.unmodifiableMap(out);

    return out;

}

From source file:org.restlet.gwt.data.Reference.java

License:LGPL

/**
 * Decodes a given string using the standard URI encoding mechanism and the
 * UTF-8 character set./*from  w  w w  . j a v a  2 s  .  c o m*/
 * 
 * @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;
}

From source file:org.restlet.gwt.data.Reference.java

License:LGPL

/**
 * 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>
 * /*from w  w  w .j  a  v  a2  s  .  c o m*/
 * @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;
}

From source file:org.switchyard.console.client.ui.application.ApplicationPresenter.java

License:Apache License

@Override
public void prepareFromRequest(PlaceRequest request) {
    super.prepareFromRequest(request);
    _applicationName = request.getParameter(NameTokens.APPLICATION_NAME_PARAM, null);
    if (_applicationName != null) {
        _applicationName = URL.decode(_applicationName);
    }// w w  w  .ja va  2  s . c  o m
}

From source file:org.switchyard.console.client.ui.artifacts.ArtifactPresenter.java

License:Apache License

@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);
    }//from   w w  w .  j  a  va  2 s.  c  om
}

From source file:org.switchyard.console.client.ui.config.ConfigPresenter.java

License:Apache License

@Override
public void prepareFromRequest(PlaceRequest request) {
    super.prepareFromRequest(request);
    _componentName = request.getParameter(NameTokens.COMPONENT_NAME_PARAM, null);
    if (_componentName != null) {
        _componentName = URL.decode(_componentName);
    }/*  ww w  . j  a v a2 s  .c  om*/
}

From source file:org.switchyard.console.client.ui.reference.ReferencePresenter.java

License:Apache License

@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);// www .  ja va 2 s. co m

    if (_referenceName != null) {
        _referenceName = URL.decode(_referenceName);
    }
    if (_applicationName != null) {
        _applicationName = URL.decode(_applicationName);
    }
}

From source file:org.switchyard.console.client.ui.service.ServicePresenter.java

License:Apache License

@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);/*from  w ww. j  a v  a 2 s.c om*/

    if (_serviceName != null) {
        _serviceName = URL.decode(_serviceName);
    }
    if (_applicationName != null) {
        _applicationName = URL.decode(_applicationName);
    }
}

From source file:org.talend.mdm.webapp.browserecords.client.widget.ImagePreviewWindow.java

License:Open Source License

private String getImageName(String imagePath) {
    String defaultName = ""; //$NON-NLS-1$
    if (imagePath != null && imagePath.contains("/")) { //$NON-NLS-1$
        defaultName = imagePath.substring(imagePath.lastIndexOf("/") + 1); //$NON-NLS-1$
        defaultName = URL.decode(defaultName);
    }//from w  ww. j  a va2 s  .  c  o  m
    return defaultName;
}