Source Code Cross Referenced for HttpSetCookie.java in  » Web-Server » Jigsaw » org » w3c » www » http » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Server » Jigsaw » org.w3c.www.http 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        // HttpSetCookie.java
002:        // $Id: HttpSetCookie.java,v 1.7 2000/08/16 21:38:00 ylafon Exp $
003:        // (c) COPYRIGHT MIT and INRIA, 1996.
004:        // Please first read the full copyright statement in file COPYRIGHT.html
005:
006:        package org.w3c.www.http;
007:
008:        public class HttpSetCookie {
009:            /**
010:             * The cookie's name.
011:             */
012:            protected String name = null;
013:            /*
014:             * The cookie's value.
015:             */
016:            protected String value = null;
017:            /**
018:             * The cookie's comment.
019:             */
020:            protected String comment = null;
021:            /**
022:             * The cookie's domain name.
023:             */
024:            protected String domain = null;
025:            /**
026:             * The cookie's max age.
027:             */
028:            protected int maxage = -1;
029:            /**
030:             * The cookie's associated path.
031:             */
032:            protected String path = null;
033:            /**
034:             * Does this cookie requires special security care by client ?
035:             */
036:            protected boolean security = false;
037:            /**
038:             * This cookie's version.
039:             */
040:            protected int version = 1;
041:
042:            /**
043:             * Get this SetCookie attached comment.
044:             * @return A String describing the reason for this SetCookie, or
045:             * <strong>null</strong>.
046:             */
047:
048:            public String getComment() {
049:                return comment;
050:            }
051:
052:            /**
053:             * Set this SetCookie attached comment.
054:             * @param comment A String giving the comments attached to that SetCookie,
055:             * or <strong>null</strong> to reset the value.
056:             */
057:
058:            public void setComment(String comment) {
059:                this .comment = comment;
060:            }
061:
062:            /**
063:             * Get the domain to which this cookie applies.
064:             * @return The string encoding of the domain to which this cookie applies
065:             * or <strong>null</strong> if undefined.
066:             */
067:
068:            public String getDomain() {
069:                return domain;
070:            }
071:
072:            /**
073:             * Define the domain for this SetCookie.
074:             * @param domain The String encoded domain name to which this cookie will
075:             * apply.
076:             */
077:
078:            public void setDomain(String domain) {
079:                this .domain = domain;
080:            }
081:
082:            /**
083:             * Get the max age value for this cookie.
084:             * @return A integer number of seconds giving the maximum age allowed for
085:             * this cookie, or <strong>-1</strong> if undefined.
086:             */
087:
088:            public int getMaxAge() {
089:                return maxage;
090:            }
091:
092:            /**
093:             * Set the max age value for this cookie.
094:             * @param maxage The max age value for this cookie, given as a number of
095:             * seconds, or <strong>-1</strong> to reset value.
096:             */
097:
098:            public void setMaxAge(int maxage) {
099:                this .maxage = maxage;
100:            }
101:
102:            /**
103:             * Get the path in which this cookie will apply.
104:             * @return The path to which this cookie applies, encoded as a String, or
105:             * <strong>null</strong> if undefined.
106:             */
107:
108:            public String getPath() {
109:                return path;
110:            }
111:
112:            /**
113:             * Set the path to which this SetCookie applies.
114:             * @param path The path, encoded as a String.
115:             */
116:
117:            public void setPath(String path) {
118:                this .path = path;
119:            }
120:
121:            /**
122:             * Get the security requirement atttached to that cookie.
123:             * @return A boolean, <strong>true</strong> if the cookie requires
124:             * special care from the client, <strong>false</strong> otherwise.
125:             */
126:
127:            public boolean getSecurity() {
128:                return security;
129:            }
130:
131:            /**
132:             * Mark/unmark this SetCookie as requiring special security when emited
133:             * back by the client.
134:             * @param onoff A boolean, <stronmg>true</strong> if the cookie that
135:             * results should be emited with special care, <strong>false</strong>
136:             * otherwise.
137:             */
138:
139:            public void setSecurity(boolean onoff) {
140:                this .security = onoff;
141:            }
142:
143:            /**
144:             * Get the SetCookie version number.
145:             * @return An integer giving the version number of this cookie.
146:             */
147:
148:            public int getVersion() {
149:                return version;
150:            }
151:
152:            /**
153:             * Set the SetCookie version number.
154:             * @param version The version number of this SetCookie.
155:             */
156:
157:            public void setVersion(int version) {
158:                this .version = version;
159:            }
160:
161:            /**
162:             * Set this SetCookie name.
163:             * @param name The name of the cookie, encoded as a String.
164:             */
165:
166:            public void setName(String name) {
167:                this .name = name;
168:            }
169:
170:            /**
171:             * Get this SetCookie cookie's name.
172:             * @return A String giving the cookie's name.
173:             */
174:
175:            public String getName() {
176:                return name;
177:            }
178:
179:            /**
180:             * Set this SetCookie cookie's value.
181:             * @param value The value, encoded as a printable String, or <strong>
182:             * null</strong> to reset the value.
183:             */
184:
185:            public void setValue(String value) {
186:                this .value = value;
187:            }
188:
189:            /**
190:             * Get the value associated with this SetCookie.
191:             * @return The value, encoded as a String, or <strong>null</strong> if
192:             * undefined.
193:             */
194:
195:            public String getValue() {
196:                return value;
197:            }
198:
199:            public String toString() {
200:                String cookie = name + "=" + value;
201:                if (comment != null)
202:                    cookie = cookie + "; comment=" + comment;
203:                if (maxage != -1)
204:                    cookie = cookie + "; maxage=" + maxage;
205:                if (domain != null)
206:                    cookie = cookie + "; domain=" + domain;
207:                if (path != null)
208:                    cookie = cookie + "; path=" + path;
209:                if (security)
210:                    cookie = cookie + "; secure";
211:                return cookie;
212:            }
213:
214:            public HttpSetCookie(boolean isValid, String name, String value) {
215:                this .name = name;
216:                this .value = value;
217:            }
218:
219:            public HttpSetCookie(String name, String value) {
220:                this .name = name;
221:                this .value = value;
222:            }
223:
224:            public HttpSetCookie() {
225:            }
226:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.