BufferedImageHttpMessageConverter.java (spring-framework-5.3.23) | : | BufferedImageHttpMessageConverter.java (spring-framework-5.3.24) | ||
---|---|---|---|---|
skipping to change at line 129 | skipping to change at line 129 | |||
public MediaType getDefaultContentType() { | public MediaType getDefaultContentType() { | |||
return this.defaultContentType; | return this.defaultContentType; | |||
} | } | |||
/** | /** | |||
* Sets the cache directory. If this property is set to an existing direc tory, | * Sets the cache directory. If this property is set to an existing direc tory, | |||
* this converter will cache image data. | * this converter will cache image data. | |||
*/ | */ | |||
public void setCacheDir(File cacheDir) { | public void setCacheDir(File cacheDir) { | |||
Assert.notNull(cacheDir, "'cacheDir' must not be null"); | Assert.notNull(cacheDir, "'cacheDir' must not be null"); | |||
Assert.isTrue(cacheDir.isDirectory(), "'cacheDir' is not a direct ory"); | Assert.isTrue(cacheDir.isDirectory(), () -> "'cacheDir' is not a directory: " + cacheDir); | |||
this.cacheDir = cacheDir; | this.cacheDir = cacheDir; | |||
} | } | |||
@Override | @Override | |||
public boolean canRead(Class<?> clazz, @Nullable MediaType mediaType) { | public boolean canRead(Class<?> clazz, @Nullable MediaType mediaType) { | |||
return (BufferedImage.class == clazz && isReadable(mediaType)); | return (BufferedImage.class == clazz && isReadable(mediaType)); | |||
} | } | |||
private boolean isReadable(@Nullable MediaType mediaType) { | private boolean isReadable(@Nullable MediaType mediaType) { | |||
if (mediaType == null) { | if (mediaType == null) { | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added |