Home / Class/ CookieEncoder Class — netty Architecture

CookieEncoder Class — netty Architecture

Architecture documentation for the CookieEncoder class in CookieEncoder.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  4ea47c19_437a_8843_e413_6bb9db1b9ca4["CookieEncoder"]
  00354a94_f8d5_407b_b149_c33cff21f99f["CookieEncoder.java"]
  4ea47c19_437a_8843_e413_6bb9db1b9ca4 -->|defined in| 00354a94_f8d5_407b_b149_c33cff21f99f
  512bfaac_de9b_e158_1fef_22c1d55f183b["CookieEncoder()"]
  4ea47c19_437a_8843_e413_6bb9db1b9ca4 -->|method| 512bfaac_de9b_e158_1fef_22c1d55f183b
  1c22f473_c132_a127_c133_789aaad34f23["validateCookie()"]
  4ea47c19_437a_8843_e413_6bb9db1b9ca4 -->|method| 1c22f473_c132_a127_c133_789aaad34f23

Relationship Graph

Source Code

codec-http/src/main/java/io/netty/handler/codec/http/cookie/CookieEncoder.java lines 25–52

public abstract class CookieEncoder {

    protected final boolean strict;

    protected CookieEncoder(boolean strict) {
        this.strict = strict;
    }

    protected void validateCookie(String name, String value) {
        if (strict) {
            int pos;

            if ((pos = firstInvalidCookieNameOctet(name)) >= 0) {
                throw new IllegalArgumentException("Cookie name contains an invalid char: " + name.charAt(pos));
            }

            CharSequence unwrappedValue = unwrapValue(value);
            if (unwrappedValue == null) {
                throw new IllegalArgumentException("Cookie value wrapping quotes are not balanced: " + value);
            }

            if ((pos = firstInvalidCookieValueOctet(unwrappedValue)) >= 0) {
                throw new IllegalArgumentException("Cookie value contains an invalid char: " +
                                                   unwrappedValue.charAt(pos));
            }
        }
    }
}

Frequently Asked Questions

What is the CookieEncoder class?
CookieEncoder is a class in the netty codebase, defined in codec-http/src/main/java/io/netty/handler/codec/http/cookie/CookieEncoder.java.
Where is CookieEncoder defined?
CookieEncoder is defined in codec-http/src/main/java/io/netty/handler/codec/http/cookie/CookieEncoder.java at line 25.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free