Example usage for org.springframework.web.util UriComponents encode

List of usage examples for org.springframework.web.util UriComponents encode

Introduction

In this page you can find the example usage for org.springframework.web.util UriComponents encode.

Prototype

public abstract UriComponents encode(Charset charset);

Source Link

Document

A variant of #encode() with a charset other than "UTF-8".

Usage

From source file:de.blizzy.documentr.markdown.macro.impl.GoogleDocsMacro.java

private String toUrl(UriComponents components) {
    try {/*from ww w .  j a  v a 2  s . c o  m*/
        return components.encode(Charsets.UTF_8.name()).toUriString();
    } catch (UnsupportedEncodingException e) {
        throw new RuntimeException(e);
    }
}