File tree Expand file tree Collapse file tree 1 file changed +2
-23
lines changed
core/src/main/java/org/springframework/ldap/support Expand file tree Collapse file tree 1 file changed +2
-23
lines changed Original file line number Diff line number Diff line change 20
20
21
21
import org .springframework .ldap .BadLdapGrammarException ;
22
22
import org .springframework .util .Assert ;
23
- import org .springframework .util .ClassUtils ;
24
-
25
- import javax .xml .bind .DatatypeConverter ;
26
23
27
24
/**
28
25
* Helper class to encode and decode ldap names and values.
@@ -300,28 +297,10 @@ public static byte[] parseBase64Binary(String val) {
300
297
}
301
298
302
299
private static String encode (byte [] decoded ) {
303
- if (ClassUtils .isPresent ("java.util.Base64" , null )) {
304
- return java .util .Base64 .getEncoder ().encodeToString (decoded );
305
- } else {
306
- return Base64Converter .encode (decoded );
307
- }
300
+ return Base64 .getEncoder ().encodeToString (decoded );
308
301
}
309
302
310
303
private static byte [] decode (String encoded ) {
311
- if (ClassUtils .isPresent ("java.util.Base64" , null )) {
312
- return java .util .Base64 .getDecoder ().decode (encoded );
313
- } else {
314
- return Base64Converter .decode (encoded );
315
- }
316
- }
317
-
318
- private static class Base64Converter {
319
- static byte [] decode (String string ) {
320
- return DatatypeConverter .parseBase64Binary (string );
321
- }
322
-
323
- static String encode (byte [] bytes ) {
324
- return DatatypeConverter .printBase64Binary (bytes );
325
- }
304
+ return Base64 .getDecoder ().decode (encoded );
326
305
}
327
306
}
You can’t perform that action at this time.
0 commit comments