blob: 8845f233fab27557831fead23fadd2e140bcb11e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.jdisc.http.filter;
import com.yahoo.jdisc.http.Cookie;
import java.util.concurrent.TimeUnit;
/**
* Wrapper of Cookie.
*
* @author tejalk
*
*/
public class JDiscCookieWrapper {
private Cookie cookie;
protected JDiscCookieWrapper(Cookie cookie) {
this.cookie = cookie;
}
public static JDiscCookieWrapper wrap(Cookie cookie) {
return new JDiscCookieWrapper(cookie);
}
@Deprecated
public String getComment() {
return cookie.getComment();
}
public String getDomain() {
return cookie.getDomain();
}
public int getMaxAge() {
return cookie.getMaxAge(TimeUnit.SECONDS);
}
public String getName() {
return cookie.getName();
}
public String getPath() {
return cookie.getPath();
}
public boolean getSecure() {
return cookie.isSecure();
}
public String getValue() {
return cookie.getValue();
}
@Deprecated
public int getVersion() {
return cookie.getVersion();
}
@Deprecated
public void setComment(String purpose) {
cookie.setComment(purpose);
}
public void setDomain(String pattern) {
cookie.setDomain(pattern);
}
public void setMaxAge(int expiry) {
cookie.setMaxAge(expiry, TimeUnit.SECONDS);
}
public void setPath(String uri) {
cookie.setPath(uri);
}
public void setSecure(boolean flag) {
cookie.setSecure(flag);
}
public void setValue(String newValue) {
cookie.setValue(newValue);
}
@Deprecated
public void setVersion(int version) {
cookie.setVersion(version);
}
/**
* Return com.yahoo.jdisc.http.Cookie
*
* @return - cookie
*/
public Cookie getCookie() {
return cookie;
}
}
|