/** * Close the template source. * * @param templateSource * The template source {@link Representation}. */ public void closeTemplateSource(Object templateSource) throws IOException { if (templateSource instanceof Representation) { ((Representation) templateSource).release(); } }
/** * Releases the source and transform sheet representations, the transformer * and the URI resolver. */ @Override public void release() { if (this.sourceRepresentation != null) { this.sourceRepresentation.release(); this.sourceRepresentation = null; } if (this.templates != null) { this.templates = null; } if (this.transformSheet != null) { this.transformSheet.release(); this.transformSheet = null; } if (this.uriResolver != null) { this.uriResolver = null; } super.release(); }
Representation responseRepresentation = response.getEntity(); if (responseRepresentation != null) { try { responseRepresentation.exhaust(); } catch (IOException e) { // handle exception } responseRepresentation.release(); }
/** * Releases the source and transform sheet representations, the transformer * and the URI resolver. */ @Override public void release() { if (this.sourceRepresentation != null) { this.sourceRepresentation.release(); this.sourceRepresentation = null; } if (this.templates != null) { this.templates = null; } if (this.transformSheet != null) { this.transformSheet.release(); this.transformSheet = null; } if (this.uriResolver != null) { this.uriResolver = null; } super.release(); }
@Override public void release() { getWrappedRepresentation().release(); }
/** * Releases the namespaces map. */ @Override public void release() { if (this.source != null) { this.source = null; } if (this.xmlRepresentation != null) { this.xmlRepresentation.release(); } super.release(); }
/** * Releases the message's entity if present. * * @see org.restlet.representation.Representation#release() */ public void release() { if (getEntity() != null) { getEntity().release(); } }
/** * Releases the wrapped DOM document and the source XML representation if * they have been defined. */ @Override public void release() { setDocument(null); if (this.xmlRepresentation != null) { this.xmlRepresentation.release(); } super.release(); }
/** * Releases the wrapped DOM document and the source XML representation if * they have been defined. */ @Override public void release() { setDocument(null); if (this.xmlRepresentation != null) { this.xmlRepresentation.release(); } super.release(); }
/** * Releases the wrapped DOM document and the source XML representation if * they have been defined. */ @Override public void release() { setDocument(null); if (this.xmlRepresentation != null) { this.xmlRepresentation.release(); } super.release(); }
/** * Releases the message's entity if present. * * @see org.restlet.representation.Representation#release() */ public void release() { if (getEntity() != null) { getEntity().release(); } }
ClientResource cr = new ClientResource(uri); //please substitute the line below with any other kind of request you need to forward Representation response = cr.put(json); if (response != null) { try { <something> }finally { response.exhaust(); response.release(); cr.release(); }
/** * Releases the file handle. */ @Override public void release() { if (isAutoDeleting() && getFile() != null) { try { IoUtils.delete(getFile(), true); } catch (Exception e) { } } setFile(null); super.release(); }
responseEntity.release();
response.getEntity().release(); } else if (response.getRequest().getMethod().equals(Method.HEAD)) { response.getEntity().release(); } else if (response.getStatus().equals(Status.SUCCESS_NO_CONTENT)) { response.getEntity().release(); } else if (response.getStatus() .equals(Status.SUCCESS_RESET_CONTENT)) { response.getEntity().release(); response.setEntity(null); } else if (response.getStatus().equals( Status.REDIRECTION_NOT_MODIFIED)) { response.getEntity().release(); } else if (response.getStatus().isInformational()) { response.getEntity().release(); response.setEntity(null);
} finally { if (entity != null) { entity.release();
"the message body", e); } finally { entity.release();
Representation entity = request.getEntity(); if (entity != null) entity.release();