* @return array
*/
public function getQuotaInfo() {
- $rootInfo=\OC\Files\Filesystem::getFileInfo('');
+ $storageInfo = OC_Helper::getStorageInfo($this->path);
return array(
- $rootInfo['size'],
- \OC\Files\Filesystem::free_space()
+ $storageInfo['used'],
+ $storageInfo['total']
);
}
/**
* Calculate the disc space
*/
- public static function getStorageInfo() {
- $rootInfo = \OC\Files\Filesystem::getFileInfo('/');
+ public static function getStorageInfo($path = '/') {
+ $rootInfo = \OC\Files\Filesystem::getFileInfo($path);
$used = $rootInfo['size'];
if ($used < 0) {
$used = 0;
}
- $free = \OC\Files\Filesystem::free_space();
+ $free = \OC\Files\Filesystem::free_space($path);
if ($free >= 0) {
$total = $free + $used;
} else {