if ( !isLegacyFilesSupported() ) {
throw new DotStateException( "File Assets have been disabled." );
}
if ( !permissionAPI.doesUserHavePermission( file, PermissionAPI.PERMISSION_READ, user, respectFrontendRoles ) ) {
throw new DotSecurityException( WebKeys.USER_PERMISSIONS_EXCEPTION );
} else if ( parent != null && !permissionAPI.doesUserHavePermission( parent, PermissionAPI.PERMISSION_CAN_ADD_CHILDREN, user, respectFrontendRoles ) ) {
throw new DotSecurityException( WebKeys.USER_PERMISSIONS_EXCEPTION );
} else if ( host != null && !permissionAPI.doesUserHavePermission( host, PermissionAPI.PERMISSION_CAN_ADD_CHILDREN, user, respectFrontendRoles ) ) {
throw new DotSecurityException( WebKeys.USER_PERMISSIONS_EXCEPTION );
}
if ( parent != null ) {
return ffac.copyFile( file, parent );
} else {