Java 类org.apache.http.message.BasicTokenIterator 实例源码

项目:purecloud-iot    文件:DefaultClientConnectionReuseStrategy.java   
@Override
public boolean keepAlive(final HttpResponse response, final HttpContext context) {

    final HttpRequest request = (HttpRequest) context.getAttribute(HttpCoreContext.HTTP_REQUEST);
    if (request != null) {
        final Header[] connHeaders = request.getHeaders(HttpHeaders.CONNECTION);
        if (connHeaders.length != 0) {
            final TokenIterator ti = new BasicTokenIterator(new BasicHeaderIterator(connHeaders, null));
            while (ti.hasNext()) {
                final String token = ti.nextToken();
                if (HTTP.CONN_CLOSE.equalsIgnoreCase(token)) {
                    return false;
                }
            }
        }
    }
    return super.keepAlive(response, context);
}
项目:lams    文件:DefaultConnectionReuseStrategy.java   
/**
 * Creates a token iterator from a header iterator.
 * This method can be overridden to replace the implementation of
 * the token iterator.
 *
 * @param hit       the header iterator
 *
 * @return  the token iterator
 */
protected TokenIterator createTokenIterator(HeaderIterator hit) {
    return new BasicTokenIterator(hit);
}
项目:remote-files-sync    文件:DefaultConnectionReuseStrategyHC4.java   
/**
 * Creates a token iterator from a header iterator.
 * This method can be overridden to replace the implementation of
 * the token iterator.
 *
 * @param hit       the header iterator
 *
 * @return  the token iterator
 */
protected TokenIterator createTokenIterator(final HeaderIterator hit) {
    return new BasicTokenIterator(hit);
}
项目:Visit    文件:DefaultConnectionReuseStrategyHC4.java   
/**
 * Creates a token iterator from a header iterator.
 * This method can be overridden to replace the implementation of
 * the token iterator.
 *
 * @param hit       the header iterator
 *
 * @return  the token iterator
 */
protected TokenIterator createTokenIterator(final HeaderIterator hit) {
    return new BasicTokenIterator(hit);
}
项目:ZTLib    文件:DefaultConnectionReuseStrategyHC4.java   
/**
 * Creates a token iterator from a header iterator.
 * This method can be overridden to replace the implementation of
 * the token iterator.
 *
 * @param hit       the header iterator
 *
 * @return  the token iterator
 */
protected TokenIterator createTokenIterator(final HeaderIterator hit) {
    return new BasicTokenIterator(hit);
}