Java Code Examples for io.netty.handler.codec.http.HttpHeaderValues#CHARSET

The following examples show how to use io.netty.handler.codec.http.HttpHeaderValues#CHARSET . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DiskFileUpload.java    From netty-4.1.22 with Apache License 2.0 6 votes vote down vote up
@Override
public String toString() {
    File file = null;
    try {
        file = getFile();
    } catch (IOException e) {
        // Should not occur.
    }

    return HttpHeaderNames.CONTENT_DISPOSITION + ": " +
           HttpHeaderValues.FORM_DATA + "; " + HttpHeaderValues.NAME + "=\"" + getName() +
            "\"; " + HttpHeaderValues.FILENAME + "=\"" + filename + "\"\r\n" +
            HttpHeaderNames.CONTENT_TYPE + ": " + contentType +
            (getCharset() != null? "; " + HttpHeaderValues.CHARSET + '=' + getCharset().name() + "\r\n" : "\r\n") +
            HttpHeaderNames.CONTENT_LENGTH + ": " + length() + "\r\n" +
            "Completed: " + isCompleted() +
            "\r\nIsInMemory: " + isInMemory() + "\r\nRealFile: " +
            (file != null ? file.getAbsolutePath() : "null") + " DefaultDeleteAfter: " +
            deleteOnExitTemporaryFile;
}
 
Example 2
Source File: MemoryFileUpload.java    From netty-4.1.22 with Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
    return HttpHeaderNames.CONTENT_DISPOSITION + ": " +
           HttpHeaderValues.FORM_DATA + "; " + HttpHeaderValues.NAME + "=\"" + getName() +
        "\"; " + HttpHeaderValues.FILENAME + "=\"" + filename + "\"\r\n" +
        HttpHeaderNames.CONTENT_TYPE + ": " + contentType +
        (getCharset() != null? "; " + HttpHeaderValues.CHARSET + '=' + getCharset().name() + "\r\n" : "\r\n") +
        HttpHeaderNames.CONTENT_LENGTH + ": " + length() + "\r\n" +
        "Completed: " + isCompleted() +
        "\r\nIsInMemory: " + isInMemory();
}