当前位置: 首页>>代码示例>>Java>>正文


Java Constants.MAX_RETRIES属性代码示例

本文整理汇总了Java中com.google.android.vending.expansion.downloader.Constants.MAX_RETRIES属性的典型用法代码示例。如果您正苦于以下问题:Java Constants.MAX_RETRIES属性的具体用法?Java Constants.MAX_RETRIES怎么用?Java Constants.MAX_RETRIES使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.google.android.vending.expansion.downloader.Constants的用法示例。


在下文中一共展示了Constants.MAX_RETRIES属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handleExceptionalStatus

/**
 * Check the HTTP response status and handle anything unusual (e.g. not
 * 200/206).
 */
private void handleExceptionalStatus(State state, InnerState innerState, HttpResponse response)
        throws StopRequest, RetryDownload {
    int statusCode = response.getStatusLine().getStatusCode();
    if (statusCode == 503 && mInfo.mNumFailed < Constants.MAX_RETRIES) {
        handleServiceUnavailable(state, response);
    }
    if (statusCode == 301 || statusCode == 302 || statusCode == 303 || statusCode == 307) {
        handleRedirect(state, response, statusCode);
    }

    int expectedStatus = innerState.mContinuingDownload ? 206
            : DownloaderService.STATUS_SUCCESS;
    if (statusCode != expectedStatus) {
        handleOtherStatus(state, innerState, statusCode);
    } else {
        // no longer redirected
        state.mRedirectCount = 0;
    }
}
 
开发者ID:SlotNSlot,项目名称:SlotNSlot_Android,代码行数:23,代码来源:DownloadThread.java

示例2: handleExceptionalStatus

/**
 * Check the HTTP response status and handle anything unusual (e.g. not
 * 200/206).
 */
private void handleExceptionalStatus(State state, InnerState innerState, HttpURLConnection connection, int responseCode)
        throws StopRequest, RetryDownload {
    if (responseCode == 503 && mInfo.mNumFailed < Constants.MAX_RETRIES) {
        handleServiceUnavailable(state, connection);
    }
    int expectedStatus = innerState.mContinuingDownload ? 206
            : DownloaderService.STATUS_SUCCESS;
    if (responseCode != expectedStatus) {
        handleOtherStatus(state, innerState, responseCode);
    } else {
        // no longer redirected
        state.mRedirectCount = 0;
    }
}
 
开发者ID:snoozinsquatch,项目名称:unity-obb-downloader,代码行数:18,代码来源:DownloadThread.java

示例3: getFinalStatusForHttpError

private int getFinalStatusForHttpError(State state) {
    if (mService.getNetworkAvailabilityState(mDB) != DownloaderService.NETWORK_OK) {
        return DownloaderService.STATUS_WAITING_FOR_NETWORK;
    } else if (mInfo.mNumFailed < Constants.MAX_RETRIES) {
        state.mCountRetry = true;
        return DownloaderService.STATUS_WAITING_TO_RETRY;
    } else {
        Log.w(Constants.TAG, "reached max retries for " + mInfo.mNumFailed);
        return DownloaderService.STATUS_HTTP_DATA_ERROR;
    }
}
 
开发者ID:snoozinsquatch,项目名称:unity-obb-downloader,代码行数:11,代码来源:DownloadThread.java


注:本文中的com.google.android.vending.expansion.downloader.Constants.MAX_RETRIES属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。