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

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

Introduction

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

Prototype

byte COLON

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

Click Source Link

Document

Colon ':'

Usage

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

License:Apache License

/**
 * Clean the String from any unallowed character
 *
 * @return the cleaned String/*from www.  ja v  a 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();
}