summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorQingping Hou <dave2008713@gmail.com>2013-02-16 17:42:06 -0500
committerQingping Hou <dave2008713@gmail.com>2013-02-16 17:42:06 -0500
commit50759607e4a94c63ae02bf6302acd191913bc834 (patch)
treea0aeb84934ea0787c5234a2031d5c0b5d880699a /apps
parentb6cbfc9cfe90533d13f51e9e91b91e965e88d39e (diff)
downloadnextcloud-server-50759607e4a94c63ae02bf6302acd191913bc834.tar.gz
nextcloud-server-50759607e4a94c63ae02bf6302acd191913bc834.zip
add file_exists method to files_trashbin app
Diffstat (limited to 'apps')
-rw-r--r--apps/files_trashbin/lib/trash.php15
1 files changed, 13 insertions, 2 deletions
diff --git a/apps/files_trashbin/lib/trash.php b/apps/files_trashbin/lib/trash.php
index d88dc1ac252..8cb44d0a684 100644
--- a/apps/files_trashbin/lib/trash.php
+++ b/apps/files_trashbin/lib/trash.php
@@ -246,8 +246,19 @@ class Trashbin {
return $size;
}
-
-
+
+ /**
+ * check to see whether a file exists in trashbin
+ * @param $file path to the file to check
+ * @return true if file exists, otherwise false
+ */
+ public static function file_exists($file) {
+ $user = \OCP\User::getUser();
+ $view = new \OC_FilesystemView('/'.$user);
+ $target = \OC_Filesystem::normalizePath('files_trashbin/'.$file);
+ return $view->file_exists($target);
+ }
+
/**
* clean up the trash bin
* @param max. available disk space for trashbin