private static String urlEncode(Object obj) throws RestServiceException {
    try {
      return URLEncoder.encode(obj.toString(), "UTF-8");
    } catch (UnsupportedEncodingException e) {
      throw new RestServiceException("Unsupported URL encoding", e, RestServiceErrorCode.InternalServerError);
    }
  }
@param obj the object to encode.
@return a UTF-8 URL encoded version of {@code obj.toString()}
ambry-frontend/src/main/java/com/github/ambry/frontend/AmbryUrlSigningService.java