From 41ba9280f7c73f608a0d74d60dba64821dcb32db Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Mon, 8 Feb 2016 12:23:48 +0100 Subject: [PATCH 1/2] Make sure fileinfo exists when calling getCheckSum in node API --- lib/private/files/node/file.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/private/files/node/file.php b/lib/private/files/node/file.php index cf163b9b76..f8279c00b8 100644 --- a/lib/private/files/node/file.php +++ b/lib/private/files/node/file.php @@ -169,6 +169,6 @@ class File extends Node implements \OCP\Files\File { * @inheritdoc */ public function getChecksum() { - return $this->fileInfo->getChecksum(); + return $this->getFileInfo()->getChecksum(); } } From 1e8e00c541726418361be9bd28bf784ac5a90657 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Mon, 8 Feb 2016 14:44:26 +0100 Subject: [PATCH 2/2] Add proper throw tags to File --- lib/public/files/file.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/public/files/file.php b/lib/public/files/file.php index 3acf24b927..1550f92682 100644 --- a/lib/public/files/file.php +++ b/lib/public/files/file.php @@ -84,4 +84,14 @@ interface File extends Node { * @since 6.0.0 */ public function hash($type, $raw = false); + + /** + * Get the stored checksum for this file + * + * @return string + * @since 9.0.0 + * @throws InvalidPathException + * @throws NotFoundException + */ + public function getChecksum(); }