public static String encodePathSegment ( String segment , String encoding ) throws UnsupportedEncodingException { return HierarchicalUriComponents . encodeUriComponent ( segment , encoding , HierarchicalUriComponents . Type . PATH_SEGMENT ) ; }
Encodes the given URI path segment with the given encoding .