Package org.apache.http.cookie

Examples of org.apache.http.cookie.SetCookie


                if (name == null || value == null) {
                    throw new XProcException(step.getNode(), "Invalid cookie: " + node);
                }

                SetCookie cookie = new BasicClientCookie(name, value);

                if (domain != null) { cookie.setDomain(domain); }
                if (path != null) { cookie.setPath(path); }

                if (expires != null) {
                    Date date = null;
                    try {
                        if (expires.length() > 21) {
                            // expires = yyyy-MM-dd'T'HH:mm:ss+00:00"
                            expires = expires.substring(0,22) + expires.substring(23);
                            date = iso8601tz.parse(expires);
                        } else {
                            // expires = yyyy-MM-dd'T'HH:mm:ss"
                            date = iso8601.parse(expires);
                        }

                        cookie.setExpiryDate(date);
                    } catch (ParseException pe) {
                        throw new XProcException(pe);
                    }
                }
View Full Code Here

TOP

Related Classes of org.apache.http.cookie.SetCookie

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.