* @return The string encoded for a URI
*/
public static String sanitizeForURI(String str) {
URLCodec codec= new URLCodec();
try {
return codec.encode(str).replaceAll("\\+", "%20");
}
catch (EncoderException ee) {
logger.warn("Error trying to encode string for URI", ee);
return str;
}