From f141f8b523f71351841f64ab1e4782b4535ca1b7 Mon Sep 17 00:00:00 2001 From: Tom Needham Date: Sun, 10 Feb 2013 14:42:23 +0100 Subject: [PATCH] Add further capabilities to /cloud/capabilitites api call --- apps/files/appinfo/app.php | 2 ++ apps/files/appinfo/routes.php | 5 ++++- apps/files/lib/capabilities.php | 24 ++++++++++++++++++++++ apps/files_encryption/appinfo/app.php | 1 + apps/files_encryption/appinfo/routes.php | 9 ++++++++ apps/files_encryption/lib/capabilities.php | 23 +++++++++++++++++++++ 6 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 apps/files/lib/capabilities.php create mode 100644 apps/files_encryption/appinfo/routes.php create mode 100644 apps/files_encryption/lib/capabilities.php diff --git a/apps/files/appinfo/app.php b/apps/files/appinfo/app.php index da17a7f2cc..6535a9b7ba 100644 --- a/apps/files/appinfo/app.php +++ b/apps/files/appinfo/app.php @@ -1,4 +1,6 @@ create('download', 'download{file}') ->requirements(array('file' => '.*')) - ->actionInclude('files/download.php'); \ No newline at end of file + ->actionInclude('files/download.php'); + +// Register with the capabilities API +OC_API::register('get', '/cloud/capabilities', array('OCA\Files\Capabilities', 'getCapabilities'), 'files', OC_API::USER_AUTH); \ No newline at end of file diff --git a/apps/files/lib/capabilities.php b/apps/files/lib/capabilities.php new file mode 100644 index 0000000000..90a5e2f4eb --- /dev/null +++ b/apps/files/lib/capabilities.php @@ -0,0 +1,24 @@ + + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace OCA\Files; + +class Capabilities { + + public static function getCapabilities() { + return new \OC_OCS_Result(array( + 'capabilities' => array( + 'files' => array( + 'bigfilechunking' => true, + 'undelete' => true, + ), + ), + )); + } + +} \ No newline at end of file diff --git a/apps/files_encryption/appinfo/app.php b/apps/files_encryption/appinfo/app.php index f83109a18e..3c100b4957 100644 --- a/apps/files_encryption/appinfo/app.php +++ b/apps/files_encryption/appinfo/app.php @@ -7,6 +7,7 @@ OC::$CLASSPATH['OCA\Encryption\Keymanager'] = 'apps/files_encryption/lib/keymana OC::$CLASSPATH['OCA\Encryption\Stream'] = 'apps/files_encryption/lib/stream.php'; OC::$CLASSPATH['OCA\Encryption\Proxy'] = 'apps/files_encryption/lib/proxy.php'; OC::$CLASSPATH['OCA\Encryption\Session'] = 'apps/files_encryption/lib/session.php'; +OC::$CLASSPATH['OCA\Encryption\Capabilities'] = 'apps/files_encryption/lib/capabilities.php'; OC_FileProxy::register( new OCA\Encryption\Proxy() ); diff --git a/apps/files_encryption/appinfo/routes.php b/apps/files_encryption/appinfo/routes.php new file mode 100644 index 0000000000..ab83432a4b --- /dev/null +++ b/apps/files_encryption/appinfo/routes.php @@ -0,0 +1,9 @@ + + * This file is licensed under the Affero General Public License version 3 or later. + * See the COPYING-README file. + */ + +// Register with the capabilities API +OC_API::register('get', '/cloud/capabilities', array('OCA\Encryption\Capabilities', 'getCapabilities'), 'files_encryption', OC_API::USER_AUTH); \ No newline at end of file diff --git a/apps/files_encryption/lib/capabilities.php b/apps/files_encryption/lib/capabilities.php new file mode 100644 index 0000000000..72baddcd04 --- /dev/null +++ b/apps/files_encryption/lib/capabilities.php @@ -0,0 +1,23 @@ + + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace OCA\Encryption; + +class Capabilities { + + public static function getCapabilities() { + return new \OC_OCS_Result(array( + 'capabilities' => array( + 'files' => array( + 'encryption' => true, + ), + ), + )); + } + +} \ No newline at end of file