Java Doc for CookieJar.java in  » Testing » HttpUnit » com » meterware » httpunit » cookies » 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 » Testing » HttpUnit » com.meterware.httpunit.cookies 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.meterware.httpunit.cookies.CookieJar

CookieJar
public class CookieJar (Code)
A collection of HTTP cookies, which can interact with cookie and set-cookie header values.
author:
   Russell Gold
author:
   Drew Varner

Inner Class :abstract class CookieRecipe
Inner Class :class CookiePress
Inner Class :class RFC2109CookieRecipe extends CookieRecipe
Inner Class :class RFC2965CookieRecipe extends CookieRecipe


Constructor Summary
public  CookieJar()
     Creates an empty cookie jar.
public  CookieJar(CookieSource source)
     Creates a cookie jar which is initially populated with cookies parsed from the Set-Cookie and Set-Cookie2 header fields.

Note that the parsing does not strictly follow the specifications, but attempts to imitate the behavior of popular browsers.


Method Summary
public  voidaddCookie(String name, String value)
     Defines a cookie to be sent to the server on every request.
 voidaddUniqueCookie(Cookie cookie)
     Add the cookie to this jar, replacing any previous matching cookie.
public  voidclear()
     Empties this cookie jar of all contents.
public  CookiegetCookie(String name)
     Returns the value of the specified cookie.
public  StringgetCookieHeaderField(URL targetURL)
     Returns the value of the cookie header to be sent to the specified URL.
public  String[]getCookieNames()
     Returns the name of all the active cookies in this cookie jar.
public  StringgetCookieValue(String name)
     Returns the value of the specified cookie.
public  CollectiongetCookies()
     Returns a collection containing all of the cookies in this jar.
public  voidputCookie(String name, String value)
     Defines a cookie to be sent to the server on every request.
public  voidupdateCookies(CookieJar newJar)
     Updates the cookies maintained in this cookie jar with those in another cookie jar.


Constructor Detail
CookieJar
public CookieJar()(Code)
Creates an empty cookie jar.



CookieJar
public CookieJar(CookieSource source)(Code)
Creates a cookie jar which is initially populated with cookies parsed from the Set-Cookie and Set-Cookie2 header fields.

Note that the parsing does not strictly follow the specifications, but attempts to imitate the behavior of popular browsers. Specifically, it allows cookie values to contain commas, which the Netscape standard does not allow for, but which is required by some servers.





Method Detail
addCookie
public void addCookie(String name, String value)(Code)
Defines a cookie to be sent to the server on every request. This bypasses the normal mechanism by which only certain cookies are sent based on their host and path.



addUniqueCookie
void addUniqueCookie(Cookie cookie)(Code)
Add the cookie to this jar, replacing any previous matching cookie.



clear
public void clear()(Code)
Empties this cookie jar of all contents.



getCookie
public Cookie getCookie(String name)(Code)
Returns the value of the specified cookie.



getCookieHeaderField
public String getCookieHeaderField(URL targetURL)(Code)
Returns the value of the cookie header to be sent to the specified URL. Will return null if no compatible cookie is defined.



getCookieNames
public String[] getCookieNames()(Code)
Returns the name of all the active cookies in this cookie jar.



getCookieValue
public String getCookieValue(String name)(Code)
Returns the value of the specified cookie.



getCookies
public Collection getCookies()(Code)
Returns a collection containing all of the cookies in this jar.



putCookie
public void putCookie(String name, String value)(Code)
Defines a cookie to be sent to the server on every request. This bypasses the normal mechanism by which only certain cookies are sent based on their host and path.
since:
   1.6



updateCookies
public void updateCookies(CookieJar newJar)(Code)
Updates the cookies maintained in this cookie jar with those in another cookie jar. Any duplicate cookies in the new jar will replace those in this jar.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.