/** * Define the DEFINITIVE URL escape function. * Note that the whole string is escaped, so * be careful what you pass into this procedure. * * @param s The string to modify. * @return The escaped expression. */ public static String urlEncode(String s) { //try {s = URLEncoder.encode(s,"UTF-8");} catch(Exception e) {s = null;} s = escapeString(s, _allowableInUrl); return s; }
/** * Define the DEFINITIVE URL constraint expression unescape function. * * @param ce The expression to unescape. * @return The unescaped expression. */ public static String unescapeURLQuery(String ce) { try { ce = unescapeString(ce); } catch(Exception e) {ce = null;} return ce; }
private static String escapeString(String in, String allowable) { return xescapeString(in, allowable, _URIEscape, false); }
if(p == null) p = ""; if(i > 0) url.append("/"); url.append(urlEncode(p)); url.append(escapeURLQuery(query)); url.append(urlEncode(fragment));
private static String unescapeString(String in) { return xunescapeString(in, _URIEscape, false); }
this.methodurl = escapeUrl ? new URI(Escape.escapeURL(url)) : new URI(url); /// validate } catch (URISyntaxException mue) { throw new HTTPException("Malformed URL: " + url, mue);
if(p == null) p = ""; if(i > 0) url.append("/"); url.append(urlEncode(p)); url.append(escapeURLQuery(query)); url.append(urlEncode(fragment));
private static String unescapeString(String in) {return xunescapeString(in, _URIEscape,false);}
/** * Define the DEFINITIVE URL constraint expression escape function. * * @param ce The expression to modify. * @return The escaped expression. */ public static String escapeURLQuery(String ce) { try { ce = escapeString(ce, _allowableInUrlQuery); } catch (Exception e) { ce = null; } return ce; }
/** * Define the DEFINITIVE URL constraint expression unescape function. * * @param ce The expression to unescape. * @return The unescaped expression. */ public static String unescapeURLQuery(String ce) { try { ce = unescapeString(ce); } catch (Exception e) { ce = null; } return ce; }
private static String escapeString(String in, String allowable) {return xescapeString(in,allowable,_URIEscape,false);}
/** * Define the DEFINITIVE URL constraint expression escape function. * * @param ce The expression to modify. * @return The escaped expression. */ public static String escapeURLQuery(String ce) { try { ce = escapeString(ce, _allowableInUrlQuery); } catch(Exception e) {ce = null;} return ce; }
/** * Define the DEFINITIVE URL escape function. * Note that the whole string is escaped, so * be careful what you pass into this procedure. * * @param s The string to modify. * @return The escaped expression. */ public static String urlEncode(String s) { //try {s = URLEncoder.encode(s,"UTF-8");} catch(Exception e) {s = null;} s = escapeString(s, _allowableInUrl); return s; }