mobile/android/thirdparty/ch/boye/httpclientandroidlib/cookie/Cookie.java

Wed, 31 Dec 2014 07:22:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:22:50 +0100
branch
TOR_BUG_3246
changeset 4
fc2d59ddac77
permissions
-rw-r--r--

Correct previous dual key logic pending first delivery installment.

     1 /*
     2  * ====================================================================
     3  * Licensed to the Apache Software Foundation (ASF) under one
     4  * or more contributor license agreements.  See the NOTICE file
     5  * distributed with this work for additional information
     6  * regarding copyright ownership.  The ASF licenses this file
     7  * to you under the Apache License, Version 2.0 (the
     8  * "License"); you may not use this file except in compliance
     9  * with the License.  You may obtain a copy of the License at
    10  *
    11  *   http://www.apache.org/licenses/LICENSE-2.0
    12  *
    13  * Unless required by applicable law or agreed to in writing,
    14  * software distributed under the License is distributed on an
    15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    16  * KIND, either express or implied.  See the License for the
    17  * specific language governing permissions and limitations
    18  * under the License.
    19  * ====================================================================
    20  *
    21  * This software consists of voluntary contributions made by many
    22  * individuals on behalf of the Apache Software Foundation.  For more
    23  * information on the Apache Software Foundation, please see
    24  * <http://www.apache.org/>.
    25  *
    26  */
    28 package ch.boye.httpclientandroidlib.cookie;
    30 import java.util.Date;
    32 /**
    33  * Cookie interface represents a token or short packet of state information
    34  * (also referred to as "magic-cookie") that the HTTP agent and the target
    35  * server can exchange to maintain a session. In its simples form an HTTP
    36  * cookie is merely a name / value pair.
    37  *
    38  * @since 4.0
    39  */
    40 public interface Cookie {
    42     /**
    43      * Returns the name.
    44      *
    45      * @return String name The name
    46      */
    47     String getName();
    49     /**
    50      * Returns the value.
    51      *
    52      * @return String value The current value.
    53      */
    54     String getValue();
    56     /**
    57      * Returns the comment describing the purpose of this cookie, or
    58      * <tt>null</tt> if no such comment has been defined.
    59      *
    60      * @return comment
    61      */
    62     String getComment();
    64     /**
    65      * If a user agent (web browser) presents this cookie to a user, the
    66      * cookie's purpose will be described by the information at this URL.
    67      */
    68     String getCommentURL();
    70     /**
    71      * Returns the expiration {@link Date} of the cookie, or <tt>null</tt>
    72      * if none exists.
    73      * <p><strong>Note:</strong> the object returned by this method is
    74      * considered immutable. Changing it (e.g. using setTime()) could result
    75      * in undefined behaviour. Do so at your peril. </p>
    76      * @return Expiration {@link Date}, or <tt>null</tt>.
    77      */
    78     Date getExpiryDate();
    80     /**
    81      * Returns <tt>false</tt> if the cookie should be discarded at the end
    82      * of the "session"; <tt>true</tt> otherwise.
    83      *
    84      * @return <tt>false</tt> if the cookie should be discarded at the end
    85      *         of the "session"; <tt>true</tt> otherwise
    86      */
    87     boolean isPersistent();
    89     /**
    90      * Returns domain attribute of the cookie. The value of the Domain
    91      * attribute specifies the domain for which the cookie is valid.
    92      *
    93      * @return the value of the domain attribute.
    94      */
    95     String getDomain();
    97     /**
    98      * Returns the path attribute of the cookie. The value of the Path
    99      * attribute specifies the subset of URLs on the origin server to which
   100      * this cookie applies.
   101      *
   102      * @return The value of the path attribute.
   103      */
   104     String getPath();
   106     /**
   107      * Get the Port attribute. It restricts the ports to which a cookie
   108      * may be returned in a Cookie request header.
   109      */
   110     int[] getPorts();
   112     /**
   113      * Indicates whether this cookie requires a secure connection.
   114      *
   115      * @return  <code>true</code> if this cookie should only be sent
   116      *          over secure connections, <code>false</code> otherwise.
   117      */
   118     boolean isSecure();
   120     /**
   121      * Returns the version of the cookie specification to which this
   122      * cookie conforms.
   123      *
   124      * @return the version of the cookie.
   125      */
   126     int getVersion();
   128     /**
   129      * Returns true if this cookie has expired.
   130      * @param date Current time
   131      *
   132      * @return <tt>true</tt> if the cookie has expired.
   133      */
   134     boolean isExpired(final Date date);
   136 }

mercurial