Example usage for org.apache.http.protocol HTTP HT

List of usage examples for org.apache.http.protocol HTTP HT

Introduction

In this page you can find the example usage for org.apache.http.protocol HTTP HT.

Prototype

int HT

To view the source code for org.apache.http.protocol HTTP HT.

Click Source Link

Usage

From source file:com.subgraph.vega.ui.httpeditor.parser.ParserBase.java

/**
 * Get the next header line of characters from a CharArrayBuffer into another CharArrayBuffer. Treats LF and CRLF as
 * valid line delimiters. Treats the entire buffer as a line if no line delimiters are found. Supports folded header
 * field values as per the HTTP/1.1 specification.
 *    /*from   w  w w. jav  a2 s. c  o  m*/
 * @param src Source buffer to read line from.
 * @param srcCursor Parser cursor for src. Adjusted to discard line delimiters.
 * @param dst Destination buffer for characters from line. 
 * @return Number of characters in line minus line delimiters, or < 0 if none found.
 */
protected int readLineHeader(final CharArrayBuffer src, final ParserCursor srcCursor,
        final CharArrayBuffer dst) {
    if (srcCursor.atEnd()) {
        return -1;
    }

    int idxPos = srcCursor.getPos();
    int chCnt = 0;
    int idxLf, idxEnd;

    do {
        idxLf = src.indexOf(HTTP.LF, idxPos, srcCursor.getUpperBound());

        if (idxLf > 0) {
            if (src.charAt(idxLf - 1) == HTTP.CR) {
                idxEnd = idxLf - 1;
            } else {
                idxEnd = idxLf;
            }
        } else {
            idxEnd = srcCursor.getUpperBound();
            idxLf = idxEnd - 1;
        }

        if (chCnt != 0) {
            while (idxPos < idxEnd && (src.charAt(idxPos) == HTTP.HT || src.charAt(idxPos) == HTTP.SP)) {
                idxPos++;
            }
            if (idxPos != idxEnd) {
                dst.append(' ');
            }
        }

        dst.append(src, idxPos, idxEnd - idxPos);
        chCnt += idxEnd - idxPos;
        idxPos = idxLf + 1;
        srcCursor.updatePos(idxPos);
    } while (idxPos < srcCursor.getUpperBound()
            && (src.charAt(idxPos) == HTTP.HT || src.charAt(idxPos) == HTTP.SP));

    return chCnt;
}

From source file:com.subgraph.vega.ui.httpeditor.parser.ParserBase.java

/**
 * Skip SP and HT characters in a line.   
 * //from   ww w  .j ava2  s  . c o m
 * @param lnBuf Buffer containing line.
 * @param lnCursor Parser cursor for lnBuf. Adjusted to one character after and SP and HT.
 */
protected void skipSpHt(final CharArrayBuffer lnBuf, final ParserCursor lnCursor) {
    int idxTo = lnCursor.getUpperBound();
    int idxPos = lnCursor.getPos();
    while (idxPos < idxTo && (lnBuf.charAt(idxPos) == HTTP.SP || lnBuf.charAt(idxPos) == HTTP.HT)) {
        idxPos++;
    }
    lnCursor.updatePos(idxPos);
}

From source file:com.google.android.gms.common.C0270e.java

private static Dialog m3391b(int i, Activity activity, Fragment fragment, int i2,
        OnCancelListener onCancelListener) {
    Builder builder;//from w w w.  j  a  va2 s .c  o m
    Intent a;
    OnClickListener c0420i;
    CharSequence c;
    if (C0516u.m4166a((Context) activity) && i == 2) {
        i = 42;
    }
    if (C0519x.m4174c()) {
        TypedValue typedValue = new TypedValue();
        activity.getTheme().resolveAttribute(16843529, typedValue, true);
        if ("Theme.Dialog.Alert".equals(activity.getResources().getResourceEntryName(typedValue.resourceId))) {
            builder = new Builder(activity, 5);
            if (builder == null) {
                builder = new Builder(activity);
            }
            builder.setMessage(C0270e.m3392b(activity, i));
            if (onCancelListener != null) {
                builder.setOnCancelListener(onCancelListener);
            }
            a = C0270e.m3382a(i);
            c0420i = fragment != null ? new C0420i(activity, a, i2) : new C0420i(fragment, a, i2);
            c = C0270e.m3397c(activity, i);
            if (c != null) {
                builder.setPositiveButton(c, c0420i);
            }
            switch (i) {
            case com.sothree.slidinguppanel.p086a.R.R.SlidingUpPanelLayout_umanoPanelHeight /*0*/:
                return null;
            case com.sothree.slidinguppanel.p086a.R.R.SlidingUpPanelLayout_umanoShadowHeight /*1*/:
                return builder.setTitle(R.common_google_play_services_install_title).create();
            case com.sothree.slidinguppanel.p086a.R.R.SlidingUpPanelLayout_umanoParalaxOffset /*2*/:
                return builder.setTitle(R.common_google_play_services_update_title).create();
            case com.sothree.slidinguppanel.p086a.R.R.SlidingUpPanelLayout_umanoFadeColor /*3*/:
                return builder.setTitle(R.common_google_play_services_enable_title).create();
            case com.sothree.slidinguppanel.p086a.R.R.SlidingUpPanelLayout_umanoFlingVelocity /*4*/:
            case com.sothree.slidinguppanel.p086a.R.R.SlidingUpPanelLayout_umanoOverlay /*6*/:
                return builder.create();
            case com.sothree.slidinguppanel.p086a.R.R.SlidingUpPanelLayout_umanoDragView /*5*/:
                Log.e("GooglePlayServicesUtil",
                        "An invalid account was specified when connecting. Please provide a valid account.");
                return builder.setTitle(R.common_google_play_services_invalid_account_title).create();
            case com.sothree.slidinguppanel.p086a.R.R.SlidingUpPanelLayout_umanoClipPanel /*7*/:
                Log.e("GooglePlayServicesUtil", "Network error occurred. Please retry request later.");
                return builder.setTitle(R.common_google_play_services_network_error_title).create();
            case com.sothree.slidinguppanel.p086a.R.R.SlidingUpPanelLayout_umanoAnchorPoint /*8*/:
                Log.e("GooglePlayServicesUtil",
                        "Internal error occurred. Please see logs for detailed information");
                return builder.create();
            case HTTP.HT /*9*/:
                Log.e("GooglePlayServicesUtil", "Google Play services is invalid. Cannot recover.");
                return builder.setTitle(R.common_google_play_services_unsupported_title).create();
            case HTTP.LF /*10*/:
                Log.e("GooglePlayServicesUtil",
                        "Developer error occurred. Please see logs for detailed information");
                return builder.create();
            case com.olacabs.customer.R.R.MapM4bAttrs_m4b_uiZoomControls /*11*/:
                Log.e("GooglePlayServicesUtil", "The application is not licensed to the user.");
                return builder.create();
            case Constants.DEFAULT_MAP_ZOOM_LEVEL /*16*/:
                Log.e("GooglePlayServicesUtil",
                        "One of the API components you attempted to connect to is not available.");
                return builder.create();
            case LangUtils.HASH_SEED /*17*/:
                Log.e("GooglePlayServicesUtil", "The specified account could not be signed in.");
                return builder.setTitle(R.common_google_play_services_sign_in_failed_title).create();
            case 42:
                return builder.setTitle(R.common_android_wear_update_title).create();
            default:
                Log.e("GooglePlayServicesUtil", "Unexpected error code " + i);
                return builder.create();
            }
        }
    }
    builder = null;
    if (builder == null) {
        builder = new Builder(activity);
    }
    builder.setMessage(C0270e.m3392b(activity, i));
    if (onCancelListener != null) {
        builder.setOnCancelListener(onCancelListener);
    }
    a = C0270e.m3382a(i);
    if (fragment != null) {
    }
    c = C0270e.m3397c(activity, i);
    if (c != null) {
        builder.setPositiveButton(c, c0420i);
    }
    switch (i) {
    case com.sothree.slidinguppanel.p086a.R.R.SlidingUpPanelLayout_umanoPanelHeight /*0*/:
        return null;
    case com.sothree.slidinguppanel.p086a.R.R.SlidingUpPanelLayout_umanoShadowHeight /*1*/:
        return builder.setTitle(R.common_google_play_services_install_title).create();
    case com.sothree.slidinguppanel.p086a.R.R.SlidingUpPanelLayout_umanoParalaxOffset /*2*/:
        return builder.setTitle(R.common_google_play_services_update_title).create();
    case com.sothree.slidinguppanel.p086a.R.R.SlidingUpPanelLayout_umanoFadeColor /*3*/:
        return builder.setTitle(R.common_google_play_services_enable_title).create();
    case com.sothree.slidinguppanel.p086a.R.R.SlidingUpPanelLayout_umanoFlingVelocity /*4*/:
    case com.sothree.slidinguppanel.p086a.R.R.SlidingUpPanelLayout_umanoOverlay /*6*/:
        return builder.create();
    case com.sothree.slidinguppanel.p086a.R.R.SlidingUpPanelLayout_umanoDragView /*5*/:
        Log.e("GooglePlayServicesUtil",
                "An invalid account was specified when connecting. Please provide a valid account.");
        return builder.setTitle(R.common_google_play_services_invalid_account_title).create();
    case com.sothree.slidinguppanel.p086a.R.R.SlidingUpPanelLayout_umanoClipPanel /*7*/:
        Log.e("GooglePlayServicesUtil", "Network error occurred. Please retry request later.");
        return builder.setTitle(R.common_google_play_services_network_error_title).create();
    case com.sothree.slidinguppanel.p086a.R.R.SlidingUpPanelLayout_umanoAnchorPoint /*8*/:
        Log.e("GooglePlayServicesUtil", "Internal error occurred. Please see logs for detailed information");
        return builder.create();
    case HTTP.HT /*9*/:
        Log.e("GooglePlayServicesUtil", "Google Play services is invalid. Cannot recover.");
        return builder.setTitle(R.common_google_play_services_unsupported_title).create();
    case HTTP.LF /*10*/:
        Log.e("GooglePlayServicesUtil", "Developer error occurred. Please see logs for detailed information");
        return builder.create();
    case com.olacabs.customer.R.R.MapM4bAttrs_m4b_uiZoomControls /*11*/:
        Log.e("GooglePlayServicesUtil", "The application is not licensed to the user.");
        return builder.create();
    case Constants.DEFAULT_MAP_ZOOM_LEVEL /*16*/:
        Log.e("GooglePlayServicesUtil",
                "One of the API components you attempted to connect to is not available.");
        return builder.create();
    case LangUtils.HASH_SEED /*17*/:
        Log.e("GooglePlayServicesUtil", "The specified account could not be signed in.");
        return builder.setTitle(R.common_google_play_services_sign_in_failed_title).create();
    case 42:
        return builder.setTitle(R.common_android_wear_update_title).create();
    default:
        Log.e("GooglePlayServicesUtil", "Unexpected error code " + i);
        return builder.create();
    }
}

From source file:com.google.android.gms.common.C0270e.java

public static String m3392b(Context context, int i) {
    Resources resources = context.getResources();
    switch (i) {//from   w  ww  .ja v a  2 s  .  c  o  m
    case com.sothree.slidinguppanel.p086a.R.R.SlidingUpPanelLayout_umanoShadowHeight /*1*/:
        return C0270e.m3390a(context.getResources())
                ? resources.getString(R.common_google_play_services_install_text_tablet)
                : resources.getString(R.common_google_play_services_install_text_phone);
    case com.sothree.slidinguppanel.p086a.R.R.SlidingUpPanelLayout_umanoParalaxOffset /*2*/:
        return resources.getString(R.common_google_play_services_update_text);
    case com.sothree.slidinguppanel.p086a.R.R.SlidingUpPanelLayout_umanoFadeColor /*3*/:
        return resources.getString(R.common_google_play_services_enable_text);
    case com.sothree.slidinguppanel.p086a.R.R.SlidingUpPanelLayout_umanoDragView /*5*/:
        return resources.getString(R.common_google_play_services_invalid_account_text);
    case com.sothree.slidinguppanel.p086a.R.R.SlidingUpPanelLayout_umanoClipPanel /*7*/:
        return resources.getString(R.common_google_play_services_network_error_text);
    case HTTP.HT /*9*/:
        return resources.getString(R.common_google_play_services_unsupported_text);
    case Constants.DEFAULT_MAP_ZOOM_LEVEL /*16*/:
        return resources.getString(R.commono_google_play_services_api_unavailable_text);
    case LangUtils.HASH_SEED /*17*/:
        return resources.getString(R.common_google_play_services_sign_in_failed_text);
    case 42:
        return resources.getString(R.common_android_wear_update_text);
    default:
        return resources.getString(R.common_google_play_services_unknown_issue);
    }
}

From source file:com.google.android.gms.common.C0270e.java

public static boolean m3394b(int i) {
    switch (i) {/*from   w  w w . j  a  va 2 s.  c  o m*/
    case com.sothree.slidinguppanel.p086a.R.R.SlidingUpPanelLayout_umanoShadowHeight /*1*/:
    case com.sothree.slidinguppanel.p086a.R.R.SlidingUpPanelLayout_umanoParalaxOffset /*2*/:
    case com.sothree.slidinguppanel.p086a.R.R.SlidingUpPanelLayout_umanoFadeColor /*3*/:
    case HTTP.HT /*9*/:
        return true;
    default:
        return false;
    }
}