congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
HttpRequestCanonicalizer.percentEncode
Code IndexAdd Tabnine to your IDE (free)

How to use
percentEncode
method
in
com.atlassian.jwt.core.HttpRequestCanonicalizer

Best Java code snippets using com.atlassian.jwt.core.HttpRequestCanonicalizer.percentEncode (Showing top 2 results out of 315)

origin: com.atlassian.jwt/jwt-core

/**
 * Construct a form-urlencoded document containing the given sequence of
 * name/parameter pairs.
 */
private static String percentEncode(Iterable<? extends Map.Entry<String, String[]>> parameters)
{
  ByteArrayOutputStream b = new ByteArrayOutputStream();
  // IOException should not be throws as we are not messing around with it between creation and use
  // (e.g. by closing it) but the methods on the OutputStream interface don't know that
  try
  {
    percentEncode(parameters, b);
    return new String(b.toByteArray());
  }
  catch (IOException e)
  {
    throw new RuntimeException(e);
  }
}
origin: com.atlassian.jwt/jwt-core

private static String canonicalizeQueryParameters(CanonicalHttpRequest request) throws UnsupportedEncodingException
{
  String result = "";
  if (null != request.getParameterMap())
  {
    List<ComparableParameter> parameterList = new ArrayList<ComparableParameter>(request.getParameterMap().size());
    for (Map.Entry<String, String[]> parameter : request.getParameterMap().entrySet())
    {
      if (!JwtConstants.JWT_PARAM_NAME.equals(parameter.getKey()))
      {
        parameterList.add(new ComparableParameter(parameter));
      }
    }
    Collections.sort(parameterList);
    result = percentEncode(getParameters(parameterList));
  }
  return result;
}
com.atlassian.jwt.coreHttpRequestCanonicalizerpercentEncode

Javadoc

Construct a form-urlencoded document containing the given sequence of name/parameter pairs.

Popular methods of HttpRequestCanonicalizer

  • canonicalize
    Assemble the components of the HTTP request into the correct format so that they can be signed or ha
  • computeCanonicalRequestHash
    Canonicalize the given CanonicalHttpRequest and hash it. This request hash can be included as a JWT
  • canonicalizeMethod
  • canonicalizeQueryParameters
  • canonicalizeUri
  • getParameters
    Retrieve the original parameters from a sorted collection.
  • safeToString

Popular in Java

  • Updating database using SQL prepared statement
  • startActivity (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • getContentResolver (Context)
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • Socket (java.net)
    Provides a client-side TCP socket.
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now