Browse Source
Allow float sizes in FileInfo for 32bits
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
pull/36120/head
Côme Chilliet
3 years ago
No known key found for this signature in database
GPG Key ID: A3E2F658B28C760A
3 changed files with
5 additions and
10 deletions
-
apps/dav/lib/Connector/Sabre/Node.php
-
lib/private/Files/FileInfo.php
-
lib/public/Files/FileInfo.php
|
|
|
@ -44,12 +44,10 @@ use OCP\Files\DavUtil; |
|
|
|
use OCP\Files\FileInfo; |
|
|
|
use OCP\Files\IRootFolder; |
|
|
|
use OCP\Files\StorageNotAvailableException; |
|
|
|
use OCP\Share\IShare; |
|
|
|
use OCP\Share\Exceptions\ShareNotFound; |
|
|
|
use OCP\Share\IManager; |
|
|
|
|
|
|
|
abstract class Node implements \Sabre\DAV\INode { |
|
|
|
|
|
|
|
/** |
|
|
|
* @var \OC\Files\View |
|
|
|
*/ |
|
|
|
@ -145,7 +143,6 @@ abstract class Node implements \Sabre\DAV\INode { |
|
|
|
* @throws \Sabre\DAV\Exception\Forbidden |
|
|
|
*/ |
|
|
|
public function setName($name) { |
|
|
|
|
|
|
|
// rename is only allowed if the update privilege is granted
|
|
|
|
if (!($this->info->isUpdateable() || ($this->info->getMountPoint() instanceof MoveableMount && $this->info->getInternalPath() === ''))) { |
|
|
|
throw new \Sabre\DAV\Exception\Forbidden(); |
|
|
|
@ -233,7 +230,7 @@ abstract class Node implements \Sabre\DAV\INode { |
|
|
|
/** |
|
|
|
* Returns the size of the node, in bytes |
|
|
|
* |
|
|
|
* @return integer |
|
|
|
* @return int|float |
|
|
|
*/ |
|
|
|
public function getSize() { |
|
|
|
return $this->info->getSize(); |
|
|
|
@ -271,7 +268,6 @@ abstract class Node implements \Sabre\DAV\INode { |
|
|
|
* @return int |
|
|
|
*/ |
|
|
|
public function getSharePermissions($user) { |
|
|
|
|
|
|
|
// check of we access a federated share
|
|
|
|
if ($user !== null) { |
|
|
|
try { |
|
|
|
|
|
|
|
@ -81,10 +81,8 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess { |
|
|
|
|
|
|
|
/** |
|
|
|
* The size of the file/folder without any sub mount |
|
|
|
* |
|
|
|
* @var int |
|
|
|
*/ |
|
|
|
private $rawSize = 0; |
|
|
|
private int|float $rawSize = 0; |
|
|
|
|
|
|
|
/** |
|
|
|
* @param string|boolean $path |
|
|
|
@ -207,7 +205,8 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess { |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @return int |
|
|
|
* @param bool $includeMounts |
|
|
|
* @return int|float |
|
|
|
*/ |
|
|
|
public function getSize($includeMounts = true) { |
|
|
|
if ($includeMounts) { |
|
|
|
|
|
|
|
@ -84,7 +84,7 @@ interface FileInfo { |
|
|
|
* Get the size in bytes for the file or folder |
|
|
|
* |
|
|
|
* @param bool $includeMounts whether or not to include the size of any sub mounts, since 16.0.0 |
|
|
|
* @return int |
|
|
|
* @return int|float |
|
|
|
* @since 7.0.0 |
|
|
|
*/ |
|
|
|
public function getSize($includeMounts = true); |
|
|
|
|