SyncProcess proc = new SyncProcess(db,"restore",true,target,app,null);
User user = (User)getRequest().getAttributes().get(App.USER_ATTR);
try {
PullSynchronizer restore = new PullSynchronizer(getContext().getLogger(),getApplication().getMetadataService(),user,db,storage,proc);
restore.setAdditive(false);
restore.sync();
if (restore.getErrorCount()>0) {
getResponse().setStatus(Status.SERVER_ERROR_INTERNAL);
return new StringRepresentation("There were "+restore.getErrorCount()+" errors. See the log for details.");
} else {
getResponse().setStatus(Status.SUCCESS_NO_CONTENT);
return null;
}
} catch (SyncException ex) {