Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/gallery.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Paroz <github@oparoz.com>2015-08-19 02:52:12 +0300
committerOlivier Paroz <github@oparoz.com>2015-08-19 02:52:13 +0300
commit7d393650e7e231a68038ccb9fd069cd95746806b (patch)
tree1ff0b8eab9bc03c84d995269b00afd40d928e0d8 /appinfo
parent8a002c4633c896c531d60d4042fe5276172bb157 (diff)
Add download API
Diffstat (limited to 'appinfo')
-rw-r--r--appinfo/application.php6
-rw-r--r--appinfo/routes.php25
2 files changed, 25 insertions, 6 deletions
diff --git a/appinfo/application.php b/appinfo/application.php
index e28112d1..cb3c8bfe 100644
--- a/appinfo/application.php
+++ b/appinfo/application.php
@@ -121,9 +121,11 @@ class Application extends App {
return new FilesController(
$c->query('AppName'),
$c->query('Request'),
+ $c->query('OCP\IURLGenerator'),
$c->query('SearchFolderService'),
$c->query('ConfigService'),
$c->query('SearchMediaService'),
+ $c->query('DownloadService'),
$c->query('Logger')
);
}
@@ -133,9 +135,11 @@ class Application extends App {
return new FilesPublicController(
$c->query('AppName'),
$c->query('Request'),
+ $c->query('OCP\IURLGenerator'),
$c->query('SearchFolderService'),
$c->query('ConfigService'),
$c->query('SearchMediaService'),
+ $c->query('DownloadService'),
$c->query('Logger')
);
}
@@ -145,9 +149,11 @@ class Application extends App {
return new FilesApiController(
$c->query('AppName'),
$c->query('Request'),
+ $c->query('OCP\IURLGenerator'),
$c->query('SearchFolderService'),
$c->query('ConfigService'),
$c->query('SearchMediaService'),
+ $c->query('DownloadService'),
$c->query('Logger')
);
}
diff --git a/appinfo/routes.php b/appinfo/routes.php
index 4e00d5b3..b9506521 100644
--- a/appinfo/routes.php
+++ b/appinfo/routes.php
@@ -71,12 +71,19 @@ return [
'url' => '/config',
'verb' => 'GET'
],
- // All the images of which a preview can be generated
+ // The list of images of which previews can be generated
[
'name' => 'files#get_list',
- 'url' => '/files',
+ 'url' => '/files/list',
'verb' => 'GET'
],
+ // File download
+ [
+ 'name' => 'files#download',
+ 'url' => '/files/download/{fileId}',
+ 'verb' => 'GET',
+ 'defaults' => ['fileId' => null]
+ ],
// Batch creation of thumbnails
[
'name' => 'preview#get_thumbnails',
@@ -99,10 +106,16 @@ return [
],
[
'name' => 'files_public#get_lists',
- 'url' => '/files.public',
+ 'url' => '/files.public/list',
'verb' => 'GET'
],
[
+ 'name' => 'files_public#download',
+ 'url' => '/files.public/download/{fileId}',
+ 'verb' => 'GET',
+ 'defaults' => ['fileId' => null]
+ ],
+ [
'name' => 'public_preview#get_thumbnails',
'url' => '/thumbnails.public',
'verb' => 'GET'
@@ -116,9 +129,9 @@ return [
* API
*/
[
- 'name' => 'config_api#preflighted_cors', // Valid for all API end points
- 'url' => '/api/{path}',
- 'verb' => 'OPTIONS',
+ 'name' => 'config_api#preflighted_cors', // Valid for all API end points
+ 'url' => '/api/{path}',
+ 'verb' => 'OPTIONS',
'requirements' => ['path' => '.+']
],
[