|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.sling.commons.json.http.Cookie
public class Cookie
Convert a web browser cookie specification to a JSONObject and back. JSON and Cookies are both notations for name/value pairs.
Constructor Summary | |
---|---|
Cookie()
|
Method Summary | |
---|---|
static java.lang.String |
escape(java.lang.String string)
Produce a copy of a string in which the characters '+', '%', '=', ';' and control characters are replaced with "%hh". |
static JSONObject |
toJSONObject(java.lang.String string)
Convert a cookie specification string into a JSONObject. |
static java.lang.String |
toString(JSONObject o)
Convert a JSONObject into a cookie specification string. |
static java.lang.String |
unescape(java.lang.String s)
Convert % hh sequences to single characters, and
convert plus to space. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Cookie()
Method Detail |
---|
public static java.lang.String escape(java.lang.String string)
string
- The source string.
public static JSONObject toJSONObject(java.lang.String string) throws JSONException
string
- The cookie specification string.
JSONException
public static java.lang.String toString(JSONObject o) throws JSONException
o
- A JSONObject
JSONException
public static java.lang.String unescape(java.lang.String s)
%
hh sequences to single characters, and
convert plus to space.
s
- A string that may contain
+
(plus) and
%
hh sequences.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |