summaryrefslogtreecommitdiff
path: root/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOCookie.java
diff options
context:
space:
mode:
authorBenjamin Culkin <scorpress@gmail.com>2024-05-20 17:58:16 -0400
committerBenjamin Culkin <scorpress@gmail.com>2024-05-20 17:58:16 -0400
commit40a9d99496e098562f090fb7ffce9e749011b131 (patch)
tree437df24d65470582e943e494a52db8ed65a881ae /projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOCookie.java
parentff072dfe782f6f22123cd4ba050828d35c0d0fbd (diff)
Formatting pass
Diffstat (limited to 'projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOCookie.java')
-rw-r--r--projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOCookie.java314
1 files changed, 145 insertions, 169 deletions
diff --git a/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOCookie.java b/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOCookie.java
index 78427f0..4c5f498 100644
--- a/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOCookie.java
+++ b/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOCookie.java
@@ -21,183 +21,159 @@ package net.wotonomy.web;
import net.wotonomy.foundation.NSDate;
/**
-* A pure java implementation of WOCookie that extends
-* javax.servlet.httpd.Cookie for greater compatibility.
-*
-* @author michael@mpowers.net
-* @author $Author: cgruber $
-* @version $Revision: 905 $
-*/
-public class WOCookie
- extends javax.servlet.http.Cookie
-{
- /**
- * Default constructor.
- */
- public WOCookie ()
- {
- super( "", "" );
- }
-
- /**
- * Constructs a cookie with the specified name and value.
- */
- public WOCookie( String aName, String aValue )
- {
- super( aName, aValue );
- }
-
- /**
- * Constructs a cookie with the specified name and value.
- * Also sets the path to the current application's path.
- */
- public static WOCookie cookieWithName (String aName, String aValue)
- {
- WOCookie result = new WOCookie( aName, aValue );
- //TODO: Set the path to the current application's path.
- return result;
- }
-
- /**
- * Constructs a cookie with the specified attributes.
- */
- public static WOCookie cookieWithName (String aName, String aValue,
- String aPath, String aDomain, NSDate expirationDate, boolean secure)
- {
- WOCookie result = new WOCookie( aName, aValue );
- result.setPath( aPath );
- result.setDomain( aDomain );
- result.setExpires( expirationDate );
- result.setSecure( secure );
+ * A pure java implementation of WOCookie that extends
+ * javax.servlet.httpd.Cookie for greater compatibility.
+ *
+ * @author michael@mpowers.net
+ * @author $Author: cgruber $
+ * @version $Revision: 905 $
+ */
+public class WOCookie extends javax.servlet.http.Cookie {
+ /**
+ * Default constructor.
+ */
+ public WOCookie() {
+ super("", "");
+ }
+
+ /**
+ * Constructs a cookie with the specified name and value.
+ */
+ public WOCookie(String aName, String aValue) {
+ super(aName, aValue);
+ }
+
+ /**
+ * Constructs a cookie with the specified name and value. Also sets the path to
+ * the current application's path.
+ */
+ public static WOCookie cookieWithName(String aName, String aValue) {
+ WOCookie result = new WOCookie(aName, aValue);
+ // TODO: Set the path to the current application's path.
+ return result;
+ }
+
+ /**
+ * Constructs a cookie with the specified attributes.
+ */
+ public static WOCookie cookieWithName(String aName, String aValue, String aPath, String aDomain,
+ NSDate expirationDate, boolean secure) {
+ WOCookie result = new WOCookie(aName, aValue);
+ result.setPath(aPath);
+ result.setDomain(aDomain);
+ result.setExpires(expirationDate);
+ result.setSecure(secure);
return result;
}
-
- /**
- * Returns the name of the cookie.
- */
- public String name ()
- {
- return this.getName();
- }
-
- /**
- * Sets the name of the cookie.
- */
- public void setName (String aString)
- {
- // super.setName( aString );
- throw new RuntimeException( "Not yet implemented." );
- }
-
- /**
- * Returns the value of the cookie.
- */
- public String value ()
- {
- return this.getValue();
- }
-
- /**
- * Sets the value of the cookie.
- */
- public void setValue (String aString)
- {
- super.setValue( aString );
- }
-
- /**
- * Gets the domain of the cookie.
- */
- public String domain ()
- {
- return this.getDomain();
- }
-
- /**
- * Sets the domain of the cookie.
- */
- public void setDomain (String aString)
- {
- super.setDomain( aString );
- }
-
- /**
- * Gets the path of the cookie.
- */
- public String path ()
- {
- return this.getPath();
- }
-
- /**
- * Sets the path of the cookie.
- */
- public void setPath (String aString)
- {
- super.setPath( aString );
- }
-
- /**
- * Gets the expiration date of the cookie.
- * If in the past, the cookie will persist until browser shutdown.
- */
- public NSDate expires ()
- {
- return new NSDate( this.getMaxAge() );
- }
-
- /**
- * Sets the expiration date of the cookie.
- */
- public void setExpires (NSDate aDate)
- {
- this.setMaxAge( (int) aDate.timeIntervalSinceNow() );
- }
-
- /**
- * Returns whether the cookie will only be sent over a secure protocol.
- */
- public boolean isSecure ()
- {
- return this.getSecure();
- }
-
- /**
- * Sets whether the cookie will only be sent over a secure protocol.
- */
- public void setIsSecure (boolean isSecure)
- {
- this.setSecure( isSecure );
- }
-
- /**
- * Returns the string as it appears in the HTTP header of the response.
- * This would normally be called by WOResponse, but is handled automatically
- * by the servlet implementation.
- */
- public String headerString ()
- {
- new RuntimeException( "Not implemented yet." );
- return null;
- }
+
+ /**
+ * Returns the name of the cookie.
+ */
+ public String name() {
+ return this.getName();
+ }
+
+ /**
+ * Sets the name of the cookie.
+ */
+ public void setName(String aString) {
+ // super.setName( aString );
+ throw new RuntimeException("Not yet implemented.");
+ }
+
+ /**
+ * Returns the value of the cookie.
+ */
+ public String value() {
+ return this.getValue();
+ }
+
+ /**
+ * Sets the value of the cookie.
+ */
+ public void setValue(String aString) {
+ super.setValue(aString);
+ }
+
+ /**
+ * Gets the domain of the cookie.
+ */
+ public String domain() {
+ return this.getDomain();
+ }
+
+ /**
+ * Sets the domain of the cookie.
+ */
+ public void setDomain(String aString) {
+ super.setDomain(aString);
+ }
+
+ /**
+ * Gets the path of the cookie.
+ */
+ public String path() {
+ return this.getPath();
+ }
+
+ /**
+ * Sets the path of the cookie.
+ */
+ public void setPath(String aString) {
+ super.setPath(aString);
+ }
+
+ /**
+ * Gets the expiration date of the cookie. If in the past, the cookie will
+ * persist until browser shutdown.
+ */
+ public NSDate expires() {
+ return new NSDate(this.getMaxAge());
+ }
+
+ /**
+ * Sets the expiration date of the cookie.
+ */
+ public void setExpires(NSDate aDate) {
+ this.setMaxAge((int) aDate.timeIntervalSinceNow());
+ }
+
+ /**
+ * Returns whether the cookie will only be sent over a secure protocol.
+ */
+ public boolean isSecure() {
+ return this.getSecure();
+ }
+
+ /**
+ * Sets whether the cookie will only be sent over a secure protocol.
+ */
+ public void setIsSecure(boolean isSecure) {
+ this.setSecure(isSecure);
+ }
+
+ /**
+ * Returns the string as it appears in the HTTP header of the response. This
+ * would normally be called by WOResponse, but is handled automatically by the
+ * servlet implementation.
+ */
+ public String headerString() {
+ new RuntimeException("Not implemented yet.");
+ return null;
+ }
}
/*
- * $Log$
- * Revision 1.2 2006/02/19 01:44:02 cgruber
- * Add xmlrpc files
- * Remove jclark and replace with dom4j and javax.xml.sax stuff
- * Re-work dependencies and imports so it all compiles.
+ * $Log$ Revision 1.2 2006/02/19 01:44:02 cgruber Add xmlrpc files Remove jclark
+ * and replace with dom4j and javax.xml.sax stuff Re-work dependencies and
+ * imports so it all compiles.
*
- * Revision 1.1 2006/02/16 13:22:22 cgruber
- * Check in all sources in eclipse-friendly maven-enabled packages.
+ * Revision 1.1 2006/02/16 13:22:22 cgruber Check in all sources in
+ * eclipse-friendly maven-enabled packages.
*
- * Revision 1.1.1.1 2000/12/21 15:53:04 mpowers
- * Contributing wotonomy.
+ * Revision 1.1.1.1 2000/12/21 15:53:04 mpowers Contributing wotonomy.
*
- * Revision 1.2 2000/12/20 16:25:50 michael
- * Added log to all files.
+ * Revision 1.2 2000/12/20 16:25:50 michael Added log to all files.
*
*
*/
-