public Response cloneStream(@ApiParam(name = "streamId", required = true) @PathParam("streamId") String streamId,
@ApiParam(name = "JSON body", required = true) CreateRequest cr) throws ValidationException, NotFoundException {
checkPermission(RestPermissions.STREAMS_CREATE);
checkPermission(RestPermissions.STREAMS_READ, streamId);
final Stream sourceStream = streamService.load(streamId);
// Create stream.
final Map<String, Object> streamData = Maps.newHashMap();
streamData.put("title", cr.title);
streamData.put("description", cr.description);
streamData.put("creator_user_id", getCurrentUser().getName());
streamData.put("created_at", Tools.iso8601());
final Stream stream = streamService.create(streamData);
streamService.pause(stream);
final String id;
streamService.save(stream);
id = stream.getId();
final List<StreamRule> sourceStreamRules;
sourceStreamRules = streamRuleService.loadForStream(sourceStream);