if (targetParent==null) {
getResponse().setStatus(Status.CLIENT_ERROR_BAD_REQUEST);
return new StringRepresentation("Cannot find parent of destination "+dest);
}
getLogger().info("Copy from "+feed.getPath()+" to "+targetParent.getPath()+"/"+segments[segments.length-1]);
CopyFeedTask task = new CopyFeedTask(app,user,feed,targetParent,segments[segments.length-1]);
task.run();
if (task.getErrors().size()>0) {
StringBuilder builder = new StringBuilder();
for (String error : task.getErrors()) {
builder.append(error);
builder.append("\n");
}
getResponse().setStatus(Status.SERVER_ERROR_INTERNAL);
return new StringRepresentation(builder.toString());