- Moved the dtstart,dtend fixing to icalUtilities so it can be called from updateFrom...
[jgroupdav.git] / src / main / java / net / bionicmessage / groupdav / HTTPCookie.java
blob6594b7870f7fb3dee8a6a290cf31de3db2ec97e8
1 /* HTTPCookie.java created March 3rd 2008
2 * Copyright (c) 2007-2009 Mathew McBride / "BionicMessage.net"
3 * Permission is hereby granted, free of charge, to any person obtaining a
4 * copy of this software and associated documentation files (the "Software"),
5 * to deal in the Software without restriction, including without limitation
6 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 * and/or sell copies of the Software, and to permit persons to whom the
8 * Software is furnished to do so, subject to the following conditions:
9 *
10 * The above copyright notice and this permission notice shall be included in
11 * all copies or substantial portions of the Software.
12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
15 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
18 * IN THE SOFTWARE.
22 package net.bionicmessage.groupdav;
24 /**
26 * @author matt
28 public class HTTPCookie {
29 protected String name = null;
30 protected String value = null;
32 public HTTPCookie() {
34 public HTTPCookie(String cookieName, String cookieValue) {
35 this.name = cookieName;
36 this.value = cookieValue;
38 public HTTPCookie(String cookieString) {
39 String[] split = cookieString.split("=");
40 this.name = split[0].trim();
41 String cookieValue = split[1].trim();
42 if (cookieValue.contains(";")) {
43 cookieValue = cookieValue.substring(0,cookieValue.indexOf(';'));
45 this.value = cookieValue;
48 public String getName() {
49 return name;
52 public String getValue() {
53 return value;
55 public String getCookieString() {
56 String cookieString = String.format("%s=%s;", this.name, this.value);
57 return cookieString;