public static function post_delete($args) { $path = $args['path']; if (substr($path, 0, 1) === '/') { $path = substr($path, 1); } $preview = new Preview(\OC_User::getUser(), 'files/', $path); $preview->deleteAllPreviews(); }