当前位置: 首页>>代码示例>>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;未经允许,请勿转载。