ResponseEntityProxy.java (httpcomponents-client-4.5.6-src) | : | ResponseEntityProxy.java (httpcomponents-client-4.5.7-src) | ||
---|---|---|---|---|
skipping to change at line 68 | skipping to change at line 68 | |||
super(entity); | super(entity); | |||
this.connHolder = connHolder; | this.connHolder = connHolder; | |||
} | } | |||
private void cleanup() throws IOException { | private void cleanup() throws IOException { | |||
if (this.connHolder != null) { | if (this.connHolder != null) { | |||
this.connHolder.close(); | this.connHolder.close(); | |||
} | } | |||
} | } | |||
private void abortConnection() throws IOException { | private void abortConnection() { | |||
if (this.connHolder != null) { | if (this.connHolder != null) { | |||
this.connHolder.abortConnection(); | this.connHolder.abortConnection(); | |||
} | } | |||
} | } | |||
public void releaseConnection() throws IOException { | public void releaseConnection() { | |||
if (this.connHolder != null) { | if (this.connHolder != null) { | |||
this.connHolder.releaseConnection(); | this.connHolder.releaseConnection(); | |||
} | } | |||
} | } | |||
@Override | @Override | |||
public boolean isRepeatable() { | public boolean isRepeatable() { | |||
return false; | return false; | |||
} | } | |||
@Override | @Override | |||
public InputStream getContent() throws IOException { | public InputStream getContent() throws IOException { | |||
return new EofSensorInputStream(this.wrappedEntity.getContent(), this); | return new EofSensorInputStream(this.wrappedEntity.getContent(), this); | |||
} | } | |||
@Deprecated | ||||
@Override | @Override | |||
public void consumeContent() throws IOException { | public void consumeContent() throws IOException { | |||
releaseConnection(); | releaseConnection(); | |||
} | } | |||
@Override | @Override | |||
public void writeTo(final OutputStream outstream) throws IOException { | public void writeTo(final OutputStream outStream) throws IOException { | |||
try { | try { | |||
if (outstream != null) { | if (outStream != null) { | |||
this.wrappedEntity.writeTo(outstream); | this.wrappedEntity.writeTo(outStream); | |||
} | } | |||
releaseConnection(); | releaseConnection(); | |||
} catch (final IOException ex) { | } catch (final IOException ex) { | |||
abortConnection(); | abortConnection(); | |||
throw ex; | throw ex; | |||
} catch (final RuntimeException ex) { | } catch (final RuntimeException ex) { | |||
abortConnection(); | abortConnection(); | |||
throw ex; | throw ex; | |||
} finally { | } finally { | |||
cleanup(); | cleanup(); | |||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added |