public void copy(Folder folderToCopy, Folder newParentFolder, User user, boolean respectFrontEndPermissions) throws DotDataException,
DotSecurityException, DotStateException, IOException {
if (!papi.doesUserHavePermission(folderToCopy, PermissionAPI.PERMISSION_READ, user, respectFrontEndPermissions)) {
throw new DotSecurityException("User " + user + " does not have permission to read " + folderToCopy.getName());
}
if (!papi.doesUserHavePermission(newParentFolder, PermissionAPI.PERMISSION_CAN_ADD_CHILDREN, user, respectFrontEndPermissions)) {
throw new DotSecurityException("User " + user + " does not have permission to add to " + newParentFolder.getName());
}
ffac.copy(folderToCopy, newParentFolder);
}