Methods Summary |
---|
public void | abortConnection()
if (managedConn != null) {
try {
managedConn.abortConnection();
} finally {
managedConn = null;
}
}
|
public void | consumeContent()
if (managedConn == null)
return;
try {
if (attemptReuse) {
// this will not trigger a callback from EofSensorInputStream
wrappedEntity.consumeContent();
managedConn.markReusable();
}
} finally {
releaseManagedConnection();
}
|
public boolean | eofDetected(java.io.InputStream wrapped)
try {
if (attemptReuse && (managedConn != null)) {
// there may be some cleanup required, such as
// reading trailers after the response body:
wrapped.close();
managedConn.markReusable();
}
} finally {
releaseManagedConnection();
}
return false;
|
public java.io.InputStream | getContent()
return new EofSensorInputStream(wrappedEntity.getContent(), this);
|
public boolean | isRepeatable()
return false;
|
public void | releaseConnection()
this.consumeContent();
|
protected void | releaseManagedConnection()Releases the connection gracefully.
The connection attribute will be nullified.
Subsequent invocations are no-ops.
if (managedConn != null) {
try {
managedConn.releaseConnection();
} finally {
managedConn = null;
}
}
|
public boolean | streamAbort(java.io.InputStream wrapped)
if (managedConn != null) {
managedConn.abortConnection();
}
return false;
|
public boolean | streamClosed(java.io.InputStream wrapped)
try {
if (attemptReuse && (managedConn != null)) {
// this assumes that closing the stream will
// consume the remainder of the response body:
wrapped.close();
managedConn.markReusable();
}
} finally {
releaseManagedConnection();
}
return false;
|
public void | writeTo(java.io.OutputStream outstream)
super.writeTo(outstream);
consumeContent();
|