summaryrefslogtreecommitdiffstats
path: root/lib/public
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2015-05-12 18:49:25 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2015-05-18 10:15:17 +0200
commit887be709f5f0dbbc6ad7b1cc1a9793d04421c5b9 (patch)
tree15cfcb45871688ecd6208f461b0d1e25171a917f /lib/public
parent73a3086945b41afa39debd89481c021934dedb67 (diff)
downloadnextcloud-server-887be709f5f0dbbc6ad7b1cc1a9793d04421c5b9.tar.gz
nextcloud-server-887be709f5f0dbbc6ad7b1cc1a9793d04421c5b9.zip
a new approach to display the error message
Diffstat (limited to 'lib/public')
-rw-r--r--lib/public/encryption/exceptions/genericencryptionexception.php11
-rw-r--r--lib/public/encryption/iencryptionmodule.php12
2 files changed, 22 insertions, 1 deletions
diff --git a/lib/public/encryption/exceptions/genericencryptionexception.php b/lib/public/encryption/exceptions/genericencryptionexception.php
index be96450d431..e97f00c88bf 100644
--- a/lib/public/encryption/exceptions/genericencryptionexception.php
+++ b/lib/public/encryption/exceptions/genericencryptionexception.php
@@ -30,17 +30,26 @@ namespace OCP\Encryption\Exceptions;
*/
class GenericEncryptionException extends \Exception {
+ /** @var string */
+ protected $hint;
+
/**
* @param string $message
* @param int $code
* @param \Exception $previous
* @since 8.1.0
*/
- public function __construct($message = '', $code = 0, \Exception $previous = null) {
+ public function __construct($message = '', $code = 0, \Exception $previous = null, $hint = '') {
if (empty($message)) {
$message = 'Unspecified encryption exception';
}
parent::__construct($message, $code, $previous);
+
+ $this->hint = $hint;
+ }
+
+ public function getHint() {
+ return $this->hint;
}
}
diff --git a/lib/public/encryption/iencryptionmodule.php b/lib/public/encryption/iencryptionmodule.php
index 0dda042d759..975e57744e9 100644
--- a/lib/public/encryption/iencryptionmodule.php
+++ b/lib/public/encryption/iencryptionmodule.php
@@ -119,4 +119,16 @@ interface IEncryptionModule {
* @since 8.1.0
*/
public function getUnencryptedBlockSize();
+
+ /**
+ * check if the encryption module is able to read the file,
+ * e.g. if all encryption keys exists
+ *
+ * @param string $path
+ * @param string $uid user for whom we want to check if he can read the file
+ * @return boolean
+ * @since 8.1.0
+ */
+ public function isReadable($path, $uid);
+
}