use of org.alfresco.repo.web.scripts.BufferedResponse in project alfresco-remote-api by Alfresco.
the class ApiWebScript method execute.
@Override
public void execute(final WebScriptRequest req, final WebScriptResponse res) throws IOException {
Map<String, String> templateVars = req.getServiceMatch().getTemplateVars();
Api api = assistant.determineApi(templateVars);
final BufferedRequest bufferedReq = getRequest(req);
final BufferedResponse bufferedRes = getResponse(res);
try {
execute(api, bufferedReq, bufferedRes);
} finally {
// Get rid of any temporary files
if (bufferedReq != null) {
bufferedReq.close();
}
}
// Ensure a response is always flushed after successful execution
if (bufferedRes != null) {
bufferedRes.writeResponse();
}
}
Aggregations