Examples of UrlEncoded


Examples of com.google.gerrit.server.UrlEncoded

      return null;
    }

    final String contextUrl = urlProvider.get();
    final DiscoveryInformation discovered = manager.associate(list);
    final UrlEncoded retTo = new UrlEncoded(contextUrl + RETURN_URL);
    retTo.put(P_MODE, mode.name());
    if (returnToken != null && returnToken.length() > 0) {
      retTo.put(P_TOKEN, returnToken);
    }
    if (remember) {
      retTo.put(P_REMEMBER, "1");
    }
    if (discovered.hasClaimedIdentifier()) {
      retTo.put(P_CLAIMED, discovered.getClaimedIdentifier().getIdentifier());
    }
    return new State(discovered, retTo, contextUrl);
  }
View Full Code Here

Examples of com.google.gerrit.server.UrlEncoded

      final Date fileDate = account.getContactFiledOn();
      final byte[] encText = encrypt(fileName, fileDate, plainText);
      final String encStr = new String(encText, "UTF-8");

      final Timestamp filedOn = account.getContactFiledOn();
      final UrlEncoded u = new UrlEncoded();
      if (storeAPPSEC != null) {
        u.put("APPSEC", storeAPPSEC);
      }
      if (account.getPreferredEmail() != null) {
        u.put("email", account.getPreferredEmail());
      }
      if (filedOn != null) {
        u.put("filed", String.valueOf(filedOn.getTime() / 1000L));
      }
      u.put("account_id", String.valueOf(account.getId().get()));
      u.put("data", encStr);
      connFactory.open(storeUrl).store(u.toString().getBytes("UTF-8"));
    } catch (IOException e) {
      log.error("Cannot store encrypted contact information", e);
      throw new ContactInformationStoreException(e);
    } catch (PGPException e) {
      log.error("Cannot store encrypted contact information", e);
View Full Code Here

Examples of org.eclipse.jetty.util.UrlEncoded

      // Throws CharacterCodingException.
      CharBuffer parsed = utf8Decoder.decode(ByteBuffer.wrap(utf8Bytes));
      parametersLine = parsed.toString();

      MultiMap<String> parameters = new UrlEncoded(parametersLine);
      CallbackHandler callbackHandler = new HttpRequestBasedCallbackHandler(parameters);

      LoginContext context = new LoginContext("Wave", subject, callbackHandler, configuration);

      // If authentication fails, login() will throw a LoginException.
View Full Code Here

Examples of org.eclipse.jetty.util.UrlEncoded

            String url = config.getLoginUrl() + OAUTH2_TOKEN_PATH;
            loginPost.setURL(url);
            loginPost.setMethod(HttpMethods.POST);
            loginPost.setRequestContentType(FORM_CONTENT_TYPE);

            final UrlEncoded nvps = new UrlEncoded();
            nvps.put("grant_type", "password");
            nvps.put("client_id", config.getClientId());
            nvps.put("client_secret", config.getClientSecret());
            nvps.put("username", config.getUserName());
            nvps.put("password", config.getPassword());
            nvps.put("format", "json");

            try {

                LOG.info("Logging clientId: {} into Salesforce url: {}", config.getClientId(), url);

                // set form content
                loginPost.setRequestContent(new ByteArrayBuffer(
                        nvps.encode(StringUtil.__UTF8, true).getBytes(StringUtil.__UTF8)));
                httpClient.send(loginPost);

                // wait for the login to finish
                final int exchangeState = loginPost.waitForDone();
View Full Code Here

Examples of org.eclipse.jetty.util.UrlEncoded

            assertTrue(requestAttributeNames.containsAll(expectedAttributeNames));

            assertEquals(null, request.getPathInfo());
            assertEquals(null, request.getPathTranslated());
           
            UrlEncoded query = new UrlEncoded();
            query.decode(request.getQueryString());
            assertThat(query.getString("do"), is("end"));
           
            // Russian for "selected=Temperature"
            UrlEncoded q2=new UrlEncoded();
            q2.decode(query.getString("else"));
            String russian = q2.encode();
            assertThat(russian, is("%D0%B2%D1%8B%D0%B1%D1%80%D0%B0%D0%BD%D0%BE=%D0%A2%D0%B5%D0%BC%D0%BF%D0%B5%D1%80%D0%B0%D1%82%D1%83%D1%80%D0%B0"));
            assertThat(query.getString("test"), is("1"));
            assertThat(query.containsKey("foreign"), is(true));
           
            String[] vals = request.getParameterValues("foreign");
View Full Code Here

Examples of org.eclipse.jetty.util.UrlEncoded

            final StatusExceptionExchange loginPost = new StatusExceptionExchange(true);
            loginPost.setURL(config.getLoginUrl() + OAUTH2_TOKEN_PATH);
            loginPost.setMethod(HttpMethods.POST);
            loginPost.setRequestContentType(FORM_CONTENT_TYPE);

            final UrlEncoded nvps = new UrlEncoded();
            nvps.put("grant_type", "password");
            nvps.put("client_id", config.getClientId());
            nvps.put("client_secret", config.getClientSecret());
            nvps.put("username", config.getUserName());
            nvps.put("password", config.getPassword());
            nvps.put("format", "json");

            try {

                // set form content
                loginPost.setRequestContent(new ByteArrayBuffer(
                        nvps.encode(StringUtil.__UTF8, true).getBytes(StringUtil.__UTF8)));
                httpClient.send(loginPost);

                // wait for the login to finish
                final int exchangeState = loginPost.waitForDone();
View Full Code Here

Examples of org.eclipse.jetty.util.UrlEncoded

      // Throws CharacterCodingException.
      CharBuffer parsed = utf8Decoder.decode(ByteBuffer.wrap(utf8Bytes));
      parametersLine = parsed.toString();

      MultiMap<String> parameters = new UrlEncoded(parametersLine);
      CallbackHandler callbackHandler = new HttpRequestBasedCallbackHandler(parameters);

      LoginContext context = new LoginContext("Wave", subject, callbackHandler, configuration);

      // If authentication fails, login() will throw a LoginException.
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.