public static String urlNonFormEncode(final String s)
        {
        if (StringUtils.isBlank(s))
            {
            LOG.warn("Could not encode blank string");
            throw new IllegalArgumentException("Blank string");
            }
        try
            {
            // We use the HttpClient encoder because the java URLEncoder
            // class uses form encoding.
            return URIUtil.encodeQuery(s, "UTF-8");
            }
        catch (final URIException e)
            {
            LOG.error ("Could not encode: " + s, e);
            
            // This really should never happen.
            assert false;
            return s;
            }
        }
public static String urlNonFormEncode ( final String s ) { if ( StringUtils . isBlank ( s ) ) { LOG . warn ( "Could not encode blank string" ) ; throw new IllegalArgumentException ( "Blank string" ) ; } try { return URIUtil . encodeQuery ( s , "UTF-8" ) ; } catch ( final URIException e ) { LOG . error ( "Could not encode: " + s , e ) ; assert false ; return s ; } }
Returns a string that has been encoded for use in a URL.

@param s The string to encode.
@return The given string encoded for use in a URL.