當前位置: 首頁>>代碼示例>>Java>>正文


Java IOExceptionFilter類代碼示例

本文整理匯總了Java中com.ning.http.client.filter.IOExceptionFilter的典型用法代碼示例。如果您正苦於以下問題:Java IOExceptionFilter類的具體用法?Java IOExceptionFilter怎麽用?Java IOExceptionFilter使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


IOExceptionFilter類屬於com.ning.http.client.filter包,在下文中一共展示了IOExceptionFilter類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testAddGetAndRemoveNingIOExceptionFilter

import com.ning.http.client.filter.IOExceptionFilter; //導入依賴的package包/類
@Test
public void testAddGetAndRemoveNingIOExceptionFilter() throws Exception {
    client = new ParsecAsyncHttpClient.Builder().build();
    // Test default value
    List<IOExceptionFilter> ioExceptionFilters = client.getIOExceptionFilters();
    assertEquals(0, ioExceptionFilters.size());

    // Test add
    client = new ParsecAsyncHttpClient.Builder()
        .addIOExceptionFilter(new MockIOExceptionFilter())
        .build();

    ioExceptionFilters = client.getIOExceptionFilters();
    assertEquals(1, ioExceptionFilters.size());
    assertTrue(ioExceptionFilters.get(0) instanceof MockIOExceptionFilter);

    // Test remove
    ParsecAsyncHttpClient.Builder builder = new ParsecAsyncHttpClient.Builder()
        .addIOExceptionFilter(new MockIOExceptionFilter());

    ioExceptionFilters = builder.build().getIOExceptionFilters();
    assertEquals(1, ioExceptionFilters.size());
    ioExceptionFilters = builder
        .removeIOExceptionFilter(ioExceptionFilters.get(0)).build().getIOExceptionFilters();
    assertEquals(0, ioExceptionFilters.size());
}
 
開發者ID:yahoo,項目名稱:parsec-libraries,代碼行數:27,代碼來源:ParsecAsyncHttpClientTest.java

示例2: handleIoException

import com.ning.http.client.filter.IOExceptionFilter; //導入依賴的package包/類
private FilterContext handleIoException(FilterContext fc) throws FilterException {
    for (IOExceptionFilter asyncFilter : config.getIOExceptionFilters()) {
        fc = asyncFilter.filter(fc);
        if (fc == null) {
            throw new NullPointerException("FilterContext is null");
        }
    }
    return fc;
}
 
開發者ID:yongbeam,項目名稱:Android-kakaologin-gradle-sample,代碼行數:10,代碼來源:SimpleAsyncHttpProvider.java

示例3: getIOExceptionFilters

import com.ning.http.client.filter.IOExceptionFilter; //導入依賴的package包/類
@Override
public List<IOExceptionFilter> getIOExceptionFilters() {
  return config.getIOExceptionFilters();
}
 
開發者ID:MachinePublishers,項目名稱:ScreenSlicer,代碼行數:5,代碼來源:LenientHttpsConfig.java

示例4: getIOExceptionFilters

import com.ning.http.client.filter.IOExceptionFilter; //導入依賴的package包/類
/**
 * Get IO exception filters.
 *
 * @return {@link IOExceptionFilter} {@link List}
 */
public List<IOExceptionFilter> getIOExceptionFilters() {
    return ningClientConfig.getIOExceptionFilters();
}
 
開發者ID:yahoo,項目名稱:parsec-libraries,代碼行數:9,代碼來源:ParsecAsyncHttpClient.java

示例5: addIOExceptionFilter

import com.ning.http.client.filter.IOExceptionFilter; //導入依賴的package包/類
/**
 * Add IO exception filter.
 *
 * @param ioExceptionFilter {@link IOExceptionFilter}
 * @return {@link ParsecAsyncHttpClient.Builder}
 */
public Builder addIOExceptionFilter(IOExceptionFilter ioExceptionFilter) {
    configBuilder.addIOExceptionFilter(ioExceptionFilter);
    return this;
}
 
開發者ID:yahoo,項目名稱:parsec-libraries,代碼行數:11,代碼來源:ParsecAsyncHttpClient.java

示例6: removeIOExceptionFilter

import com.ning.http.client.filter.IOExceptionFilter; //導入依賴的package包/類
/**
 * Remove IO exception filter.
 *
 * @param ioExceptionFilter {@link IOExceptionFilter}
 * @return {@link ParsecAsyncHttpClient.Builder}
 */
public Builder removeIOExceptionFilter(IOExceptionFilter ioExceptionFilter) {
    configBuilder.removeIOExceptionFilter(ioExceptionFilter);
    return this;
}
 
開發者ID:yahoo,項目名稱:parsec-libraries,代碼行數:11,代碼來源:ParsecAsyncHttpClient.java


注:本文中的com.ning.http.client.filter.IOExceptionFilter類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。