use of org.apache.syncope.client.console.rest.WorkflowRestClient in project syncope by apache.
the class WorkflowDefGETResource method newResourceResponse.
@Override
protected ResourceResponse newResourceResponse(final Attributes attributes) {
final WorkflowDefinitionTO toGet = getWorkflowDefinition(attributes);
ResourceResponse response = new ResourceResponse();
response.disableCaching();
response.setContentType(MediaType.APPLICATION_JSON);
response.setTextEncoding(StandardCharsets.UTF_8.name());
response.setWriteCallback(new WriteCallback() {
@Override
public void writeData(final Attributes attributes) throws IOException {
IOUtils.copy(new WorkflowRestClient().getDefinition(MediaType.APPLICATION_JSON_TYPE, toGet.getKey()), attributes.getResponse().getOutputStream());
}
});
return response;
}
Aggregations