use of com.enonic.xp.archive.RestoreContentException in project xp by enonic.
the class ContentServiceImplTest_restore method restore_not_archived.
@Test
public void restore_not_archived() throws Exception {
final Content content = createContent(ContentPath.ROOT, "archive");
final RestoreContentException ex = assertThrows(RestoreContentException.class, () -> this.contentService.restore(RestoreContentParams.create().contentId(content.getId()).restoreContentListener(listener).build()));
assertEquals("/archive", ex.getPath().toString());
}
use of com.enonic.xp.archive.RestoreContentException in project xp by enonic.
the class RestoreContentCommand method execute.
RestoreContentsResult execute() {
params.validate();
try {
final RestoreContentsResult restoredContents = doExecute();
this.nodeService.refresh(RefreshMode.ALL);
return restoredContents;
} catch (MoveNodeException e) {
throw new RestoreContentException(e.getMessage(), ContentNodeHelper.translateNodePathToContentPath(e.getPath()));
} catch (NodeAccessException e) {
throw new ContentAccessException(e);
}
}
Aggregations