Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tfs/src/main/java/hudson/plugins/tfs/util/TeamRestClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import net.sf.json.JSONObject;
import org.apache.commons.io.IOUtils;

import javax.xml.bind.DatatypeConverter;
import org.apache.commons.codec.binary.Base64; // This was replaced with Apache Commons and not java.util.Base64 because the encode function there requires compilation with java 8 and the library is currently on java 7.
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
Expand Down Expand Up @@ -70,7 +70,7 @@ static String createAuthorization(final StandardUsernamePasswordCredentials cred
final String password = secretPassword.getPlainText();
final String credPair = username + ":" + password;
final byte[] credBytes = credPair.getBytes(MediaType.UTF_8);
final String base64enc = DatatypeConverter.printBase64Binary(credBytes);
final String base64enc = Base64.encodeBase64String(credBytes);
final String result = "Basic " + base64enc;
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import org.junit.Assert;
import org.junit.runner.Description;

import javax.xml.bind.DatatypeConverter;
import org.apache.commons.codec.binary.Base64; // This was replaced with Apache Commons and not java.util.Base64 because the encode function there requires compilation with java 8 and the library is currently on java 7.
import java.net.Inet4Address;
import java.net.Inet6Address;
import java.net.InetAddress;
Expand Down Expand Up @@ -169,7 +169,7 @@ else if (ipv4Address != null) {
}

public static String formatFriendlyName(final byte[] addressBytes) {
final String base64 = DatatypeConverter.printBase64Binary(addressBytes);
final String base64 = Base64.encodeBase64String(addressBytes);
final String slashToMinus = base64.replace('/', '-');
return slashToMinus;
}
Expand Down