Skip to content

Commit 672c631

Browse files
Polish
See gh-36033
1 parent 985918b commit 672c631

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/io/Base64ProtocolResolver.java

+4-7
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,14 @@ class Base64ProtocolResolver implements ProtocolResolver {
3535
@Override
3636
public Resource resolve(String location, ResourceLoader resourceLoader) {
3737
if (location.startsWith(BASE64_PREFIX)) {
38-
return new Base64ByteArrayResource(location.substring(BASE64_PREFIX.length()));
38+
String value = location.substring(BASE64_PREFIX.length());
39+
return new ByteArrayResource(decode(value));
3940
}
4041
return null;
4142
}
4243

43-
static class Base64ByteArrayResource extends ByteArrayResource {
44-
45-
Base64ByteArrayResource(String location) {
46-
super(Base64.getDecoder().decode(location.getBytes()));
47-
}
48-
44+
private static byte[] decode(String location) {
45+
return Base64.getDecoder().decode(location);
4946
}
5047

5148
}

0 commit comments

Comments
 (0)