contentLength support for Resource decoding
Expose the known content length, if known, in the InputStreamResource returned by ResourceHttpMessageConverter or ResourceDecoder. See gh-24292
This commit is contained in:
committed by
Rossen Stoyanchev
parent
e3e7d90415
commit
e96b71acf3
@@ -84,6 +84,11 @@ public class ResourceHttpMessageConverter extends AbstractHttpMessageConverter<R
|
||||
public String getFilename() {
|
||||
return inputMessage.getHeaders().getContentDisposition().getFilename();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long contentLength() {
|
||||
return inputMessage.getHeaders().getContentLength();
|
||||
}
|
||||
};
|
||||
}
|
||||
else if (Resource.class == clazz || ByteArrayResource.class.isAssignableFrom(clazz)) {
|
||||
|
||||
Reference in New Issue
Block a user