org.springframework.http.HttpMessage

Here are the examples of the java api org.springframework.http.HttpMessage taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

3 Examples 7

18 Source : DefaultMultipartMessageReader.java
with MIT License
from Vip-Augus

@Nullable
private static byte[] boundary(HttpMessage message) {
    MediaType contentType = message.getHeaders().getContentType();
    if (contentType != null) {
        String boundary = contentType.getParameter("boundary");
        if (boundary != null) {
            return boundary.getBytes(StandardCharsets.ISO_8859_1);
        }
    }
    return null;
}

17 Source : DecoderHttpMessageReader.java
with MIT License
from Vip-Augus

/**
 * Determine the Content-Type of the HTTP message based on the
 * "Content-Type" header or otherwise default to
 * {@link MediaType#APPLICATION_OCTET_STREAM}.
 * @param inputMessage the HTTP message
 * @return the MediaType, possibly {@code null}.
 */
@Nullable
protected MediaType getContentType(HttpMessage inputMessage) {
    MediaType contentType = inputMessage.getHeaders().getContentType();
    return (contentType != null ? contentType : MediaType.APPLICATION_OCTET_STREAM);
}

17 Source : DefaultLogFormatter.java
with Apache License 2.0
from markhobson

protected Charset getCharset(HttpMessage message) {
    return Optional.ofNullable(message.getHeaders().getContentType()).map(MediaType::getCharset).orElse(DEFAULT_CHARSET);
}