Examples of PercentEscaper


Examples of com.chargebee.gdata.PercentEscaper

    protected static String uri(String ... paths){
        StringBuilder strBuf = new StringBuilder();
        for (String path : paths) {
            try {//Using URLEncoder is wrong as it encodes for form. Replace it with Google's CharEscapers.java
                strBuf.append('/').append(new PercentEscaper(PercentEscaper.SAFEPATHCHARS_URLENCODER, false) .escape(path));
            } catch (Exception ex) {
                throw new RuntimeException(ex);
            }
        }
        return strBuf.toString();
View Full Code Here

Examples of org.waveprotocol.wave.util.escapers.PercentEscaper

  }

  // *** Utility methods

  private void configureRedirectString(String location) {
    PercentEscaper escaper =
        new PercentEscaper(PercentEscaper.SAFEQUERYSTRINGCHARS_URLENCODER, false);
    String queryStr = "r=" + escaper.escape(location);
    when(req.getQueryString()).thenReturn(queryStr);
  }
View Full Code Here

Examples of org.waveprotocol.wave.util.escapers.PercentEscaper

    when(req.getQueryString()).thenReturn(queryStr);
  }

  private void attemptLogin(String address, String password, boolean expectSuccess) throws IOException {
    // The query string is escaped.
    PercentEscaper escaper = new PercentEscaper(PercentEscaper.SAFECHARS_URLENCODER, true);
    String data =
        "address=" + escaper.escape(address) + "&" + "password=" + escaper.escape(password);

    Reader reader = new StringReader(data);
    when(req.getReader()).thenReturn(new BufferedReader(reader));
    PrintWriter writer = mock(PrintWriter.class);
    when(resp.getWriter()).thenReturn(writer);
View Full Code Here

Examples of org.waveprotocol.wave.util.escapers.PercentEscaper

  @Override
  public String getLoginUrl(String redirect) {
    if (Strings.isNullOrEmpty(redirect)) {
      return SIGN_IN_URL;
    } else {
      PercentEscaper escaper =
          new PercentEscaper(PercentEscaper.SAFEQUERYSTRINGCHARS_URLENCODER, false);
      String queryStr = "?r=" + escaper.escape(redirect);
      return SIGN_IN_URL + queryStr;
    }
  }
View Full Code Here

Examples of org.waveprotocol.wave.util.escapers.PercentEscaper

  @Override
  public String getLoginUrl(String redirect) {
    if (Strings.isNullOrEmpty(redirect)) {
      return SIGN_IN_URL;
    } else {
      PercentEscaper escaper =
          new PercentEscaper(PercentEscaper.SAFEQUERYSTRINGCHARS_URLENCODER, false);
      String queryStr = "?r=" + escaper.escape(redirect);
      return SIGN_IN_URL + queryStr;
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.