summaryrefslogtreecommitdiffstats
path: root/lib/private/files/fileinfo.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/files/fileinfo.php')
-rw-r--r--lib/private/files/fileinfo.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/private/files/fileinfo.php b/lib/private/files/fileinfo.php
index b64c5d4e112..e7afeb4ccce 100644
--- a/lib/private/files/fileinfo.php
+++ b/lib/private/files/fileinfo.php
@@ -196,4 +196,28 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess {
public function isShareable() {
return $this->checkPermissions(\OCP\PERMISSION_SHARE);
}
+
+ /**
+ * Check if a file or folder is shared
+ * @return bool
+ */
+ public function isShared() {
+ $sid = $this->getStorage()->getId();
+ if (!is_null($sid)) {
+ $sid = explode(':', $sid);
+ return ($sid[0] === 'shared');
+ }
+
+ return false;
+ }
+
+ public function isMounted() {
+ $sid = $this->getStorage()->getId();
+ if (!is_null($sid)) {
+ $sid = explode(':', $sid);
+ return ($sid[0] !== 'local' and $sid[0] !== 'home');
+ }
+
+ return false;
+ }
}