Tabnine Logo
CookieOrigin.getPort
Code IndexAdd Tabnine to your IDE (free)

How to use
getPort
method
in
org.apache.commons.httpclient.cookie.CookieOrigin

Best Java code snippets using org.apache.commons.httpclient.cookie.CookieOrigin.getPort (Showing top 10 results out of 315)

origin: commons-httpclient/commons-httpclient

  /**
   * Match cookie port attribute. If the Port attribute is not specified
   * in header, the cookie can be sent to any port. Otherwise, the request port
   * must be in the cookie's port list.
   */
  public boolean match(final Cookie cookie, final CookieOrigin origin) {
    if (cookie == null) {
      throw new IllegalArgumentException("Cookie may not be null");
    }
    if (origin == null) {
      throw new IllegalArgumentException("Cookie origin may not be null");
    }
    if (cookie instanceof Cookie2) {
      Cookie2 cookie2 = (Cookie2) cookie;
      int port = origin.getPort();
      if (cookie2.isPortAttributeSpecified()) {
        if (cookie2.getPorts() == null) {
          LOG.warn("Invalid cookie state: port not specified");
          return false;
        }
        if (!portMatch(port, cookie2.getPorts())) {
          return false;
        }
      }
      return true;
    } else {
      return false;
    }
  }
}
origin: commons-httpclient/commons-httpclient

/**
 * Validate cookie port attribute. If the Port attribute was specified
 * in header, the request port must be in cookie's port list.
 */
public void validate(final Cookie cookie, final CookieOrigin origin)
    throws MalformedCookieException {
  if (cookie == null) {
    throw new IllegalArgumentException("Cookie may not be null");
  }
  if (origin == null) {
    throw new IllegalArgumentException("Cookie origin may not be null");
  }
  if (cookie instanceof Cookie2) {
    Cookie2 cookie2 = (Cookie2) cookie;
    int port = origin.getPort();
    if (cookie2.isPortAttributeSpecified()) {
      if (!portMatch(port, cookie2.getPorts())) {
        throw new MalformedCookieException(
            "Port attribute violates RFC 2965: "
            + "Request port not found in cookie's port list.");
      }
    }
  }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-httpclient

  /**
   * Match cookie port attribute. If the Port attribute is not specified
   * in header, the cookie can be sent to any port. Otherwise, the request port
   * must be in the cookie's port list.
   */
  public boolean match(final Cookie cookie, final CookieOrigin origin) {
    if (cookie == null) {
      throw new IllegalArgumentException("Cookie may not be null");
    }
    if (origin == null) {
      throw new IllegalArgumentException("Cookie origin may not be null");
    }
    if (cookie instanceof Cookie2) {
      Cookie2 cookie2 = (Cookie2) cookie;
      int port = origin.getPort();
      if (cookie2.isPortAttributeSpecified()) {
        if (cookie2.getPorts() == null) {
          LOG.warn("Invalid cookie state: port not specified");
          return false;
        }
        if (!portMatch(port, cookie2.getPorts())) {
          return false;
        }
      }
      return true;
    } else {
      return false;
    }
  }
}
origin: org.apache.commons/httpclient

  /**
   * Match cookie port attribute. If the Port attribute is not specified
   * in header, the cookie can be sent to any port. Otherwise, the request port
   * must be in the cookie's port list.
   */
  public boolean match(final Cookie cookie, final CookieOrigin origin) {
    if (cookie == null) {
      throw new IllegalArgumentException("Cookie may not be null");
    }
    if (origin == null) {
      throw new IllegalArgumentException("Cookie origin may not be null");
    }
    if (cookie instanceof Cookie2) {
      Cookie2 cookie2 = (Cookie2) cookie;
      int port = origin.getPort();
      if (cookie2.isPortAttributeSpecified()) {
        if (cookie2.getPorts() == null) {
          LOG.warn("Invalid cookie state: port not specified");
          return false;
        }
        if (!portMatch(port, cookie2.getPorts())) {
          return false;
        }
      }
      return true;
    } else {
      return false;
    }
  }
}
origin: org.apache.commons/com.springsource.org.apache.commons.httpclient

/**
 * Validate cookie port attribute. If the Port attribute was specified
 * in header, the request port must be in cookie's port list.
 */
public void validate(final Cookie cookie, final CookieOrigin origin)
    throws MalformedCookieException {
  if (cookie == null) {
    throw new IllegalArgumentException("Cookie may not be null");
  }
  if (origin == null) {
    throw new IllegalArgumentException("Cookie origin may not be null");
  }
  if (cookie instanceof Cookie2) {
    Cookie2 cookie2 = (Cookie2) cookie;
    int port = origin.getPort();
    if (cookie2.isPortAttributeSpecified()) {
      if (!portMatch(port, cookie2.getPorts())) {
        throw new MalformedCookieException(
            "Port attribute violates RFC 2965: "
            + "Request port not found in cookie's port list.");
      }
    }
  }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-httpclient

/**
 * Validate cookie port attribute. If the Port attribute was specified
 * in header, the request port must be in cookie's port list.
 */
public void validate(final Cookie cookie, final CookieOrigin origin)
    throws MalformedCookieException {
  if (cookie == null) {
    throw new IllegalArgumentException("Cookie may not be null");
  }
  if (origin == null) {
    throw new IllegalArgumentException("Cookie origin may not be null");
  }
  if (cookie instanceof Cookie2) {
    Cookie2 cookie2 = (Cookie2) cookie;
    int port = origin.getPort();
    if (cookie2.isPortAttributeSpecified()) {
      if (!portMatch(port, cookie2.getPorts())) {
        throw new MalformedCookieException(
            "Port attribute violates RFC 2965: "
            + "Request port not found in cookie's port list.");
      }
    }
  }
}
origin: org.apache.commons/httpclient

/**
 * Validate cookie port attribute. If the Port attribute was specified
 * in header, the request port must be in cookie's port list.
 */
public void validate(final Cookie cookie, final CookieOrigin origin)
    throws MalformedCookieException {
  if (cookie == null) {
    throw new IllegalArgumentException("Cookie may not be null");
  }
  if (origin == null) {
    throw new IllegalArgumentException("Cookie origin may not be null");
  }
  if (cookie instanceof Cookie2) {
    Cookie2 cookie2 = (Cookie2) cookie;
    int port = origin.getPort();
    if (cookie2.isPortAttributeSpecified()) {
      if (!portMatch(port, cookie2.getPorts())) {
        throw new MalformedCookieException(
            "Port attribute violates RFC 2965: "
            + "Request port not found in cookie's port list.");
      }
    }
  }
}
origin: org.wso2.commons-httpclient/commons-httpclient

/**
 * Validate cookie port attribute. If the Port attribute was specified
 * in header, the request port must be in cookie's port list.
 */
public void validate(final Cookie cookie, final CookieOrigin origin)
    throws MalformedCookieException {
  if (cookie == null) {
    throw new IllegalArgumentException("Cookie may not be null");
  }
  if (origin == null) {
    throw new IllegalArgumentException("Cookie origin may not be null");
  }
  if (cookie instanceof Cookie2) {
    Cookie2 cookie2 = (Cookie2) cookie;
    int port = origin.getPort();
    if (cookie2.isPortAttributeSpecified()) {
      if (!portMatch(port, cookie2.getPorts())) {
        throw new MalformedCookieException(
            "Port attribute violates RFC 2965: "
            + "Request port not found in cookie's port list.");
      }
    }
  }
}
origin: org.wso2.commons-httpclient/commons-httpclient

  /**
   * Match cookie port attribute. If the Port attribute is not specified
   * in header, the cookie can be sent to any port. Otherwise, the request port
   * must be in the cookie's port list.
   */
  public boolean match(final Cookie cookie, final CookieOrigin origin) {
    if (cookie == null) {
      throw new IllegalArgumentException("Cookie may not be null");
    }
    if (origin == null) {
      throw new IllegalArgumentException("Cookie origin may not be null");
    }
    if (cookie instanceof Cookie2) {
      Cookie2 cookie2 = (Cookie2) cookie;
      int port = origin.getPort();
      if (cookie2.isPortAttributeSpecified()) {
        if (cookie2.getPorts() == null) {
          LOG.warn("Invalid cookie state: port not specified");
          return false;
        }
        if (!portMatch(port, cookie2.getPorts())) {
          return false;
        }
      }
      return true;
    } else {
      return false;
    }
  }
}
origin: org.apache.commons/com.springsource.org.apache.commons.httpclient

  /**
   * Match cookie port attribute. If the Port attribute is not specified
   * in header, the cookie can be sent to any port. Otherwise, the request port
   * must be in the cookie's port list.
   */
  public boolean match(final Cookie cookie, final CookieOrigin origin) {
    if (cookie == null) {
      throw new IllegalArgumentException("Cookie may not be null");
    }
    if (origin == null) {
      throw new IllegalArgumentException("Cookie origin may not be null");
    }
    if (cookie instanceof Cookie2) {
      Cookie2 cookie2 = (Cookie2) cookie;
      int port = origin.getPort();
      if (cookie2.isPortAttributeSpecified()) {
        if (cookie2.getPorts() == null) {
          LOG.warn("Invalid cookie state: port not specified");
          return false;
        }
        if (!portMatch(port, cookie2.getPorts())) {
          return false;
        }
      }
      return true;
    } else {
      return false;
    }
  }
}
org.apache.commons.httpclient.cookieCookieOrigingetPort

Popular methods of CookieOrigin

  • <init>
  • getHost
  • getPath
  • isSecure

Popular in Java

  • Start an intent from android
  • getSupportFragmentManager (FragmentActivity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getExternalFilesDir (Context)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • JPanel (javax.swing)
  • Join (org.hibernate.mapping)
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Top plugins for Android Studio
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