Skip to content

Commit

Permalink
Drop dependency on commons-codec (#317)
Browse files Browse the repository at this point in the history
  • Loading branch information
basil authored Oct 15, 2021
1 parent dfbd4ec commit a3e624e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/hudson/plugins/emailext/plugins/CssInliner.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import java.net.URL;
import java.net.URLConnection;
import java.text.MessageFormat;
import java.util.Base64;
import java.util.StringTokenizer;
import java.util.logging.Level;
import java.util.logging.Logger;
import net.htmlparser.jericho.Source;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringEscapeUtils;
import org.jsoup.Jsoup;
Expand Down Expand Up @@ -117,7 +117,7 @@ private void inlineImages(Document doc) {

urlConnection.getContent();
byte[] srcContent = IOUtils.toByteArray(url.openStream());
String base64 = new Base64().encodeToString(srcContent);
String base64 = Base64.getEncoder().encodeToString(srcContent);

img.attr(IMG_SRC_ATTR, MessageFormat.format("data:{0};base64,{1}", contentType, base64));
} catch (Exception e) {
Expand Down

0 comments on commit a3e624e

Please sign in to comment.