Java 类org.apache.http.client.methods.AbortableHttpRequest 实例源码

项目:sinacloud-sdk-java    文件:HttpMethodReleaseInputStream.java   
/**
 * Forces the release of an HttpMethod's connection in a way that will
 * perform all the necessary cleanup through the correct use of HttpClient
 * methods.
 *
 * @throws IOException
 */
protected void releaseConnection() throws IOException {
    if (!alreadyReleased) {
        if (!underlyingStreamConsumed) {
            // Underlying input stream has not been consumed, abort method
            // to force connection to be closed and cleaned-up.
            if (httpRequest instanceof AbortableHttpRequest) {
                AbortableHttpRequest abortableHttpRequest = (AbortableHttpRequest)httpRequest;
                abortableHttpRequest.abort();
            }
        }
        inputStream.close();
        alreadyReleased = true;
    }
}
项目:rhq-agent-plugin-plugin    文件:UploadMojo.java   
private void abortQuietly(AbortableHttpRequest httpRequest) {
    if (httpRequest != null) {
        httpRequest.abort();
    }
}