Example usage for org.apache.commons.httpclient.util URIUtil encodeWithinPath

List of usage examples for org.apache.commons.httpclient.util URIUtil encodeWithinPath

Introduction

In this page you can find the example usage for org.apache.commons.httpclient.util URIUtil encodeWithinPath.

Prototype

public static String encodeWithinPath(String unescaped) throws URIException 

Source Link

Document

Escape and encode a string regarded as within the path component of an URI with the default protocol charset.

Usage

From source file:org.alfresco.dataprep.UserService.java

private String encodeUserName(String userName) {
    try {/*w  ww .  j  a  v a2 s  . c om*/
        return URIUtil.encodeWithinPath(userName);
    } catch (URIException e) {
        throw new RuntimeException("Failed to encode user " + userName);
    }
}