@@ -0,0 +1,1457 @@
+package org.ccci.gto.android.common.util;%0A%0Aimport android.support.annotation.NonNull;%0A%0Aimport org.apache.http.HeaderElement;%0Aimport org.apache.http.message.BasicHeaderValueParser;%0A%0Aimport java.util.Collections;%0Aimport java.util.HashMap;%0Aimport java.util.Locale;%0Aimport java.util.Map;%0A%0Apublic final class HttpHeaderUtils %7B%0A    public static Challenge parseChallenge(@NonNull final String challenge) %7B%0A        // separate the scheme from the params%0A        final String%5B%5D parts = challenge.trim().split(%22 %5Ct%22, 2);%0A        final String scheme = parts%5B0%5D.trim();%0A%0A        // parse any attributes%0A        final Map%3CString, String%3E params = new HashMap%3C%3E();%0A        if(parts.length %3E 1) %7B%0A            try %7B%0A                for (final HeaderElement param : BasicHeaderValueParser.parseElements(parts%5B1%5D, null)) %7B%0A                    params.put(param.getName().toLowerCase(Locale.US), param.getValue());%0A                %7D%0A            %7D catch (final Exception ignored) %7B%0A            %7D%0A        %7D%0A%0A        // return the parsed challenge%0A        return new Challenge(scheme, params);%0A    %7D%0A%0A    public static final class Challenge %7B%0A        @NonNull%0A        public final String scheme;%0A        @NonNull%0A        public final Map%3CString, String%3E params;%0A%0A        private Challenge(@NonNull final String scheme, @NonNull final Map%3CString, String%3E params) %7B%0A            this.scheme = scheme;%0A            this.params = Collections.unmodifiableMap(params);%0A        %7D%0A    %7D%0A%7D%0A

add HttpHeaderUtils which is used for parsing the WWW-Authenticate header