Skip to content

Commit e3804f2

Browse files
committed
Move off incompatible Base64Utils.
1 parent 4f304bf commit e3804f2

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

spring-cloud-consul-binder/src/main/java/org/springframework/cloud/consul/binder/ConsulInboundMessageProducer.java

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2013-2019 the original author or authors.
2+
* Copyright 2013-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,6 +16,7 @@
1616

1717
package org.springframework.cloud.consul.binder;
1818

19+
import java.util.Base64;
1920
import java.util.List;
2021
import java.util.concurrent.Executors;
2122
import java.util.concurrent.ScheduledExecutorService;
@@ -29,8 +30,6 @@
2930

3031
import org.springframework.integration.endpoint.MessageProducerSupport;
3132

32-
import static org.springframework.util.Base64Utils.decodeFromString;
33-
3433
/**
3534
* Adapter that receives Messages from Consul Events, converts them into Spring
3635
* Integration Messages, and sends the results to a Message Channel.
@@ -98,7 +97,7 @@ public void getEvents() {
9897
for (Event event : events) {
9998
// Map<String, Object> headers = new HashMap<>();
10099
// headers.put(MessageHeaders.REPLY_CHANNEL, outputChannel.)
101-
String decoded = new String(decodeFromString(event.getPayload()));
100+
String decoded = new String(Base64.getDecoder().decode(event.getPayload()));
102101
sendMessage(getMessageBuilderFactory().withPayload(decoded)
103102
// TODO: support headers
104103
.build());

spring-cloud-consul-config/src/main/java/org/springframework/cloud/consul/config/ConsulPropertySource.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2013-2019 the original author or authors.
2+
* Copyright 2013-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -19,6 +19,7 @@
1919
import java.io.ByteArrayInputStream;
2020
import java.io.IOException;
2121
import java.nio.charset.Charset;
22+
import java.util.Base64;
2223
import java.util.LinkedHashMap;
2324
import java.util.List;
2425
import java.util.Map;
@@ -37,7 +38,6 @@
3738

3839
import static org.springframework.cloud.consul.config.ConsulConfigProperties.Format.PROPERTIES;
3940
import static org.springframework.cloud.consul.config.ConsulConfigProperties.Format.YAML;
40-
import static org.springframework.util.Base64Utils.decodeFromString;
4141

4242
/**
4343
* @author Spencer Gibb
@@ -175,7 +175,7 @@ public String getDecoded(String value) {
175175
if (value == null) {
176176
return null;
177177
}
178-
return new String(decodeFromString(value));
178+
return new String(Base64.getDecoder().decode(value));
179179
}
180180

181181
protected Map<String, Object> getProperties() {

0 commit comments

Comments
 (0)