Bug 730637 - Base64 support for HttpClient in Android 2.1. r=nalexander

This commit is contained in:
Richard Newman 2012-02-27 10:23:33 -08:00
parent e05ad0c8aa
commit 1071670860
14 changed files with 19 additions and 19 deletions

View File

@ -82,4 +82,4 @@ public class HttpClientAndroidLog {
Log.i(logTag, message.toString(), t);
}
}
}

View File

@ -78,4 +78,4 @@ public interface RedirectStrategy {
HttpResponse response,
HttpContext context) throws ProtocolException;
}
}

View File

@ -43,4 +43,4 @@ public interface Idn {
* @return the Unicode domain name
*/
String toUnicode(String punycode);
}
}

View File

@ -72,4 +72,4 @@ public class JdkIdn implements Idn {
}
}
}
}

View File

@ -123,4 +123,4 @@ public class Rfc3492Idn implements Idn {
return output.toString();
}
}
}

View File

@ -59,4 +59,4 @@ public interface ClientCookie extends Cookie {
boolean containsAttribute(String name);
}
}

View File

@ -28,7 +28,7 @@ package ch.boye.httpclientandroidlib.impl.auth;
import ch.boye.httpclientandroidlib.annotation.NotThreadSafe;
import android.util.Base64;
import org.mozilla.apache.commons.codec.binary.Base64;
import ch.boye.httpclientandroidlib.Header;
import ch.boye.httpclientandroidlib.HttpRequest;
import ch.boye.httpclientandroidlib.auth.AuthenticationException;
@ -161,8 +161,8 @@ public class BasicScheme extends RFC2617Scheme {
tmp.append(":");
tmp.append((credentials.getPassword() == null) ? "null" : credentials.getPassword());
byte[] base64password = Base64.encode(
EncodingUtils.getBytes(tmp.toString(), charset), Base64.NO_WRAP);
byte[] base64password = Base64.encodeBase64(
EncodingUtils.getBytes(tmp.toString(), charset));
CharArrayBuffer buffer = new CharArrayBuffer(32);
if (proxy) {

View File

@ -33,7 +33,7 @@ import java.util.Arrays;
import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;
import android.util.Base64;
import org.mozilla.apache.commons.codec.binary.Base64;
import ch.boye.httpclientandroidlib.util.EncodingUtils;
/**
@ -612,8 +612,8 @@ final class NTLMEngineImpl implements NTLMEngine {
/** Constructor to use when message contents are known */
NTLMMessage(String messageBody, int expectedType) throws NTLMEngineException {
messageContents = Base64.decode(EncodingUtils.getBytes(messageBody,
DEFAULT_CHARSET), Base64.NO_WRAP);
messageContents = Base64.decodeBase64(EncodingUtils.getBytes(messageBody,
DEFAULT_CHARSET));
// Look for NTLM message
if (messageContents.length < SIGNATURE.length)
throw new NTLMEngineException("NTLM message decoding error - packet too short");
@ -746,7 +746,7 @@ final class NTLMEngineImpl implements NTLMEngine {
} else {
resp = messageContents;
}
return EncodingUtils.getAsciiString(Base64.encode(resp, Base64.NO_WRAP));
return EncodingUtils.getAsciiString(Base64.encodeBase64(resp));
}
}

View File

@ -199,4 +199,4 @@ public class DefaultRedirectStrategy implements RedirectStrategy {
}
}
}
}

View File

@ -218,4 +218,4 @@ public class BestMatchSpec implements CookieSpec {
return "best-match";
}
}
}

View File

@ -64,4 +64,4 @@ public class RFC2965CommentUrlAttributeHandler implements CookieAttributeHandler
return true;
}
}
}

View File

@ -64,4 +64,4 @@ public class RFC2965DiscardAttributeHandler implements CookieAttributeHandler {
return true;
}
}
}

View File

@ -191,4 +191,4 @@ public class RFC2965DomainAttributeHandler implements CookieAttributeHandler {
return effectiveHostWithoutDomain.indexOf('.') == -1;
}
}
}

View File

@ -95,4 +95,4 @@ public class RFC2965VersionAttributeHandler implements CookieAttributeHandler {
return true;
}
}
}