Skip to content

Commit

Permalink
mark com.sun.xml.messaging.saaj.util.Base64 as deprecated and repla…
Browse files Browse the repository at this point in the history
…ce it with `java.util.Base64`

closes eclipse-ee4j#202

Signed-off-by: Ronny Perinke <23166289+sephiroth-j@users.noreply.github.com>
  • Loading branch information
sephiroth-j committed May 3, 2023
1 parent e9a9a21 commit c665669
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2022 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
Expand All @@ -18,6 +18,7 @@
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
import java.util.Base64;
import java.util.Iterator;
import java.util.StringTokenizer;
import java.util.logging.Level;
Expand All @@ -32,7 +33,6 @@
import jakarta.xml.soap.SOAPMessage;

import com.sun.xml.messaging.saaj.SOAPExceptionImpl;
import com.sun.xml.messaging.saaj.util.Base64;
import com.sun.xml.messaging.saaj.util.ByteInputStream;
import com.sun.xml.messaging.saaj.util.LogDomainConstants;
import com.sun.xml.messaging.saaj.util.ParseUtil;
Expand Down Expand Up @@ -553,7 +553,7 @@ private void initAuthUserInfo(HttpURLConnection conn, String userInfo) {
concat,
nameBytes.length,
passwdBytes.length);
String auth = "Basic " + new String(Base64.encode(concat));
String auth = "Basic " + Base64.getEncoder().encodeToString(concat);
conn.setRequestProperty("Authorization", auth);
if (dL > 0)
d("Adding auth " + auth);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2022 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
Expand All @@ -22,7 +22,9 @@
* This class is used by XML Schema binary format validation
*
* @author Jeffrey Rodriguez
* @deprecated Use {@link java.util.Base64} instead
*/
@Deprecated(forRemoval = true)
public final class Base64 {


Expand Down

0 comments on commit c665669

Please sign in to comment.