Tabnine Logo
Cookie2.setVersion
Code IndexAdd Tabnine to your IDE (free)

How to use
setVersion
method
in
org.apache.commons.httpclient.cookie.Cookie2

Best Java code snippets using org.apache.commons.httpclient.cookie.Cookie2.setVersion (Showing top 5 results out of 315)

origin: commons-httpclient/commons-httpclient

/**
 * Parse cookie version attribute.
 */
public void parse(final Cookie cookie, final String value)
    throws MalformedCookieException {
  if (cookie == null) {
    throw new IllegalArgumentException("Cookie may not be null");
  }
  if (cookie instanceof Cookie2) {
    Cookie2 cookie2 = (Cookie2) cookie;
    if (value == null) {
      throw new MalformedCookieException(
          "Missing value for version attribute");
    }
    int version = -1;
    try {
      version = Integer.parseInt(value);
    } catch (NumberFormatException e) {
      version = -1;
    }
    if (version < 0) {
      throw new MalformedCookieException("Invalid cookie version.");
    }
    cookie2.setVersion(version);
    cookie2.setVersionAttributeSpecified(true);
  }
}
origin: org.apache.commons/com.springsource.org.apache.commons.httpclient

/**
 * Parse cookie version attribute.
 */
public void parse(final Cookie cookie, final String value)
    throws MalformedCookieException {
  if (cookie == null) {
    throw new IllegalArgumentException("Cookie may not be null");
  }
  if (cookie instanceof Cookie2) {
    Cookie2 cookie2 = (Cookie2) cookie;
    if (value == null) {
      throw new MalformedCookieException(
          "Missing value for version attribute");
    }
    int version = -1;
    try {
      version = Integer.parseInt(value);
    } catch (NumberFormatException e) {
      version = -1;
    }
    if (version < 0) {
      throw new MalformedCookieException("Invalid cookie version.");
    }
    cookie2.setVersion(version);
    cookie2.setVersionAttributeSpecified(true);
  }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-httpclient

/**
 * Parse cookie version attribute.
 */
public void parse(final Cookie cookie, final String value)
    throws MalformedCookieException {
  if (cookie == null) {
    throw new IllegalArgumentException("Cookie may not be null");
  }
  if (cookie instanceof Cookie2) {
    Cookie2 cookie2 = (Cookie2) cookie;
    if (value == null) {
      throw new MalformedCookieException(
          "Missing value for version attribute");
    }
    int version = -1;
    try {
      version = Integer.parseInt(value);
    } catch (NumberFormatException e) {
      version = -1;
    }
    if (version < 0) {
      throw new MalformedCookieException("Invalid cookie version.");
    }
    cookie2.setVersion(version);
    cookie2.setVersionAttributeSpecified(true);
  }
}
origin: org.apache.commons/httpclient

/**
 * Parse cookie version attribute.
 */
public void parse(final Cookie cookie, final String value)
    throws MalformedCookieException {
  if (cookie == null) {
    throw new IllegalArgumentException("Cookie may not be null");
  }
  if (cookie instanceof Cookie2) {
    Cookie2 cookie2 = (Cookie2) cookie;
    if (value == null) {
      throw new MalformedCookieException(
          "Missing value for version attribute");
    }
    int version = -1;
    try {
      version = Integer.parseInt(value);
    } catch (NumberFormatException e) {
      version = -1;
    }
    if (version < 0) {
      throw new MalformedCookieException("Invalid cookie version.");
    }
    cookie2.setVersion(version);
    cookie2.setVersionAttributeSpecified(true);
  }
}
origin: org.wso2.commons-httpclient/commons-httpclient

/**
 * Parse cookie version attribute.
 */
public void parse(final Cookie cookie, final String value)
    throws MalformedCookieException {
  if (cookie == null) {
    throw new IllegalArgumentException("Cookie may not be null");
  }
  if (cookie instanceof Cookie2) {
    Cookie2 cookie2 = (Cookie2) cookie;
    if (value == null) {
      throw new MalformedCookieException(
          "Missing value for version attribute");
    }
    int version = -1;
    try {
      version = Integer.parseInt(value);
    } catch (NumberFormatException e) {
      version = -1;
    }
    if (version < 0) {
      throw new MalformedCookieException("Invalid cookie version.");
    }
    cookie2.setVersion(version);
    cookie2.setVersionAttributeSpecified(true);
  }
}
org.apache.commons.httpclient.cookieCookie2setVersion

Javadoc

Indicates whether the cookie had a version attribute specified in the Set-Cookie2 response header.

Popular methods of Cookie2

  • <init>
    Creates a cookie with the given name, value, domain attribute, path attribute, expiration attribute,
  • getDomain
  • getExpiryDate
  • getName
  • getPath
  • getPorts
    Get the Port attribute. It restricts the ports to which a cookie may be returned in a Cookie request
  • getValue
  • getVersion
  • isDomainAttributeSpecified
  • isPathAttributeSpecified
  • isPortAttributeBlank
  • isPortAttributeSpecified
  • isPortAttributeBlank,
  • isPortAttributeSpecified,
  • isVersionAttributeSpecified,
  • setCommentURL,
  • setDiscard,
  • setPortAttributeBlank,
  • setPortAttributeSpecified,
  • setPorts,
  • setVersionAttributeSpecified

Popular in Java

  • Reactive rest calls using spring rest template
  • getSupportFragmentManager (FragmentActivity)
  • getContentResolver (Context)
  • setScale (BigDecimal)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now