@@ -0,0 +1,2314 @@
+/**%0A * An implementation of the HTTP Digest authentication scheme for Android.%0A *%0A * With a small effort you can use it to get HTTP digest working with HttpURLConnection or any%0A * other HTTP stack.%0A * %3Cp%3E%0A * Here is an example of how to make a request and respond to a Digest challenge:%0A *%0A * %3Cblockquote%3E%3Cpre%3E%7B@code%0A * // Step 1. Create the connection%0A * URL url = new URL(%22http://httpbin.org/digest-auth/auth/user/passwd%22);%0A * HttpURLConnection connection = (HttpURLConnection) url.openConnection();%0A *%0A * // Step 2. Make the request and check to see if the response contains an authorization challenge%0A * if (connection.getResponseCode() == HttpURLConnection.HTTP_UNAUTHORIZED) %7B%0A *     // Step 3. Create a authentication object from the challenge...%0A *     DigestAuthentication auth = DigestAuthentication.fromResponse(connection);%0A *     // ...with correct credentials%0A *     auth.username(%22user%22).password(%22passwd%22);%0A *%0A *     // Step 4 (Optional). Check if the challenge was a digest challenge of a supported type%0A *     if (!auth.canRespond()) %7B%0A *         // No digest challenge or a challenge of an unsupported type - do something else or fail%0A *         return;%0A *     %7D%0A *%0A *     // Step 5. Create a new connection, identical to the original one...%0A *     connection = (HttpURLConnection) url.openConnection();%0A *     // ...and set the Authorization header on the request, with the challenge response%0A *     connection.setRequestProperty(DigestChallengeResponse.HTTP_HEADER_AUTHORIZATION,%0A *     auth.getAuthorizationForRequest(%22GET%22, connection.getURL().getPath()));%0A * %7D%0A * %7D%3C/pre%3E%3C/blockquote%3E%0A *%0A * %7B@link com.albroco.barebonesdigest.DigestAuthentication%7D is the main entry point of the API,%0A * read the documentation for more examples. Some other useful classes include:%0A * %3Cul%3E%0A * %3Cli%3E%7B@link com.albroco.barebonesdigest.WwwAuthenticateHeader%7D which can be used to parse%0A * challenges from WWW-Authenticate headers, including challenges of other types than Digest.%3C/li%3E%0A * %3Cli%3E%7B@link com.albroco.barebonesdigest.DigestChallenge%7D which provides functionality for%0A * parsing digest challenges.%3C/li%3E%0A * %3Cli%3E%7B@link com.albroco.barebonesdigest.DigestChallengeResponse%7D which provides functionality%0A * for generating responses to digest challenges.%3C/li%3E%0A * %3C/ul%3E%0A */%0Apackage com.albroco.barebonesdigest;

Add top-level package info to javadoc