Example usage for io.netty.handler.codec.http HttpConstants EQUALS

List of usage examples for io.netty.handler.codec.http HttpConstants EQUALS

Introduction

In this page you can find the example usage for io.netty.handler.codec.http HttpConstants EQUALS.

Prototype

byte EQUALS

To view the source code for io.netty.handler.codec.http HttpConstants EQUALS.

Click Source Link

Document

Equals '='

Usage

From source file:divconq.http.multipart.HttpPostMultipartRequestDecoder.java

License:Apache License

/**
 * Clean the String from any unallowed character
 *
 * @return the cleaned String/*  w  w  w. ja va 2 s .co  m*/
 */
private static String cleanString(String field) {
    StringBuilder sb = new StringBuilder(field.length());
    for (int i = 0; i < field.length(); i++) {
        char nextChar = field.charAt(i);
        if (nextChar == HttpConstants.COLON) {
            sb.append(HttpConstants.SP);
        } else if (nextChar == HttpConstants.COMMA) {
            sb.append(HttpConstants.SP);
        } else if (nextChar == HttpConstants.EQUALS) {
            sb.append(HttpConstants.SP);
        } else if (nextChar == HttpConstants.SEMICOLON) {
            sb.append(HttpConstants.SP);
        } else if (nextChar == HttpConstants.HT) {
            sb.append(HttpConstants.SP);
        } else if (nextChar == HttpConstants.DOUBLE_QUOTE) {
            // nothing added, just removes it
        } else {
            sb.append(nextChar);
        }
    }
    return sb.toString().trim();
}

From source file:org.ireland.jnetty.util.http.ServletServerCookieEncoder.java

License:Apache License

static void addUnquoted(StringBuilder sb, String name, String val) {
    sb.append(name);/*from   w  ww.  ja  va2s. co m*/
    sb.append((char) HttpConstants.EQUALS);
    sb.append(val);
    sb.append((char) HttpConstants.SEMICOLON);
    sb.append((char) HttpConstants.SP);
}

From source file:org.ireland.jnetty.util.http.ServletServerCookieEncoder.java

License:Apache License

static void addQuoted(StringBuilder sb, String name, String val) {
    if (val == null) {
        val = "";
    }/* ww w.  j  a  v a 2 s  .c om*/

    sb.append(name);
    sb.append((char) HttpConstants.EQUALS);
    sb.append((char) HttpConstants.DOUBLE_QUOTE);
    sb.append(val.replace("\\", "\\\\").replace("\"", "\\\""));
    sb.append((char) HttpConstants.DOUBLE_QUOTE);
    sb.append((char) HttpConstants.SEMICOLON);
    sb.append((char) HttpConstants.SP);
}

From source file:org.ireland.jnetty.util.http.ServletServerCookieEncoder.java

License:Apache License

static void add(StringBuilder sb, String name, long val) {
    sb.append(name);// w  ww.  ja  v  a  2  s. c  o m
    sb.append((char) HttpConstants.EQUALS);
    sb.append(val);
    sb.append((char) HttpConstants.SEMICOLON);
    sb.append((char) HttpConstants.SP);
}