fix: remaining references to obsolete sun.misc.Base64Encoder
This commit is contained in:
parent
523d806b56
commit
a5bc33db70
3 changed files with 9 additions and 9 deletions
|
@ -536,8 +536,8 @@ String.prototype.count = function(str) {
|
|||
* @memberof {String}
|
||||
*/
|
||||
String.prototype.enbase64 = function() {
|
||||
var bytes = new java.lang.String(this) . getBytes();
|
||||
return new Packages.sun.misc.BASE64Encoder().encode(bytes);
|
||||
var bytes = java.lang.String(this).getBytes('utf-8');
|
||||
return String(java.lang.String(Packages.org.apache.commons.codec.binary.Base64.encodeBase64(bytes), 'utf-8'));
|
||||
};
|
||||
|
||||
|
||||
|
@ -547,8 +547,8 @@ String.prototype.enbase64 = function() {
|
|||
* @memberof {String}
|
||||
*/
|
||||
String.prototype.debase64 = function() {
|
||||
var bytes = new Packages.sun.misc.BASE64Decoder().decodeBuffer(this);
|
||||
return String(new java.lang.String(bytes));
|
||||
var bytes = Packages.org.apache.commons.codec.binary.Base64.decodeBase64(this);
|
||||
return String(java.lang.String(bytes, 'utf-8'));
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -159,8 +159,8 @@ helma.Http = function() {
|
|||
* @param {String} password The password
|
||||
*/
|
||||
this.setCredentials = function(username, password) {
|
||||
var str = new java.lang.String(username + ":" + password);
|
||||
credentials = (new Packages.sun.misc.BASE64Encoder()).encode(str.getBytes());
|
||||
var str = username + ":" + password;
|
||||
credentials = str.enbase64();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -123,11 +123,11 @@ jala.XmlRpcRequest = function(url, methodName) {
|
|||
* @param {String} password The password
|
||||
*/
|
||||
this.setCredentials = function(username, password) {
|
||||
var str = new java.lang.String(username + ":" + password);
|
||||
credentials = (new Packages.sun.misc.BASE64Encoder()).encode(str.getBytes());
|
||||
var str = username + ":" + password;
|
||||
credentials = str.enbase64();
|
||||
return;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Returns the credentials of this request
|
||||
* @returns The base46 encoded credentials of this request
|
||||
|
|
Loading…
Add table
Reference in a new issue