Fix formatting
This commit is contained in:
parent
8ab2e47556
commit
b7dd520784
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2014 the original author or authors.
|
* Copyright 2002-2015 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -210,26 +210,21 @@ public class BufferedImageHttpMessageConverter implements HttpMessageConverter<B
|
||||||
throws IOException, HttpMessageNotWritableException {
|
throws IOException, HttpMessageNotWritableException {
|
||||||
|
|
||||||
if (outputMessage instanceof StreamingHttpOutputMessage) {
|
if (outputMessage instanceof StreamingHttpOutputMessage) {
|
||||||
StreamingHttpOutputMessage streamingOutputMessage =
|
StreamingHttpOutputMessage streamingOutputMessage = (StreamingHttpOutputMessage) outputMessage;
|
||||||
(StreamingHttpOutputMessage) outputMessage;
|
|
||||||
streamingOutputMessage.setBody(new StreamingHttpOutputMessage.Body() {
|
streamingOutputMessage.setBody(new StreamingHttpOutputMessage.Body() {
|
||||||
@Override
|
@Override
|
||||||
public void writeTo(OutputStream outputStream) throws IOException {
|
public void writeTo(OutputStream outputStream) throws IOException {
|
||||||
writeInternal(image, contentType, outputMessage.getHeaders(),
|
writeInternal(image, contentType, outputMessage.getHeaders(), outputStream);
|
||||||
outputStream);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
writeInternal(image, contentType, outputMessage.getHeaders(),
|
writeInternal(image, contentType, outputMessage.getHeaders(), outputMessage.getBody());
|
||||||
outputMessage.getBody());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void writeInternal(BufferedImage image, MediaType contentType,
|
private void writeInternal(BufferedImage image, MediaType contentType, HttpHeaders headers,
|
||||||
HttpHeaders headers, OutputStream body)
|
OutputStream body) throws IOException, HttpMessageNotWritableException {
|
||||||
throws IOException, HttpMessageNotWritableException {
|
|
||||||
|
|
||||||
if (contentType == null || contentType.isWildcardType() || contentType.isWildcardSubtype()) {
|
if (contentType == null || contentType.isWildcardType() || contentType.isWildcardSubtype()) {
|
||||||
contentType = getDefaultContentType();
|
contentType = getDefaultContentType();
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2014 the original author or authors.
|
* Copyright 2002-2015 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -257,8 +257,8 @@ public class FormHttpMessageConverter implements HttpMessageConverter<MultiValue
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void writeForm(MultiValueMap<String, String> form, MediaType contentType, HttpOutputMessage outputMessage)
|
private void writeForm(MultiValueMap<String, String> form, MediaType contentType,
|
||||||
throws IOException {
|
HttpOutputMessage outputMessage) throws IOException {
|
||||||
|
|
||||||
Charset charset;
|
Charset charset;
|
||||||
if (contentType != null) {
|
if (contentType != null) {
|
||||||
|
@ -291,8 +291,7 @@ public class FormHttpMessageConverter implements HttpMessageConverter<MultiValue
|
||||||
outputMessage.getHeaders().setContentLength(bytes.length);
|
outputMessage.getHeaders().setContentLength(bytes.length);
|
||||||
|
|
||||||
if (outputMessage instanceof StreamingHttpOutputMessage) {
|
if (outputMessage instanceof StreamingHttpOutputMessage) {
|
||||||
StreamingHttpOutputMessage streamingOutputMessage =
|
StreamingHttpOutputMessage streamingOutputMessage = (StreamingHttpOutputMessage) outputMessage;
|
||||||
(StreamingHttpOutputMessage) outputMessage;
|
|
||||||
streamingOutputMessage.setBody(new StreamingHttpOutputMessage.Body() {
|
streamingOutputMessage.setBody(new StreamingHttpOutputMessage.Body() {
|
||||||
@Override
|
@Override
|
||||||
public void writeTo(OutputStream outputStream) throws IOException {
|
public void writeTo(OutputStream outputStream) throws IOException {
|
||||||
|
@ -314,8 +313,7 @@ public class FormHttpMessageConverter implements HttpMessageConverter<MultiValue
|
||||||
headers.setContentType(contentType);
|
headers.setContentType(contentType);
|
||||||
|
|
||||||
if (outputMessage instanceof StreamingHttpOutputMessage) {
|
if (outputMessage instanceof StreamingHttpOutputMessage) {
|
||||||
StreamingHttpOutputMessage streamingOutputMessage =
|
StreamingHttpOutputMessage streamingOutputMessage = (StreamingHttpOutputMessage) outputMessage;
|
||||||
(StreamingHttpOutputMessage) outputMessage;
|
|
||||||
streamingOutputMessage.setBody(new StreamingHttpOutputMessage.Body() {
|
streamingOutputMessage.setBody(new StreamingHttpOutputMessage.Body() {
|
||||||
@Override
|
@Override
|
||||||
public void writeTo(OutputStream outputStream) throws IOException {
|
public void writeTo(OutputStream outputStream) throws IOException {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2014 the original author or authors.
|
* Copyright 2002-2015 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2014 the original author or authors.
|
* Copyright 2002-2015 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
Loading…
Reference in New Issue