routes.php 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?php
  2. /**
  3. * @author Bart Visscher <bartv@thisnet.nl>
  4. * @author Lukas Reschke <lukas@owncloud.com>
  5. * @author Morris Jobke <hey@morrisjobke.de>
  6. * @author Tobias Kaminsky <tobias@kaminsky.me>
  7. * @author Tom Needham <tom@owncloud.com>
  8. * @author Vincent Petry <pvince81@owncloud.com>
  9. *
  10. * @copyright Copyright (c) 2015, ownCloud, Inc.
  11. * @license AGPL-3.0
  12. *
  13. * This code is free software: you can redistribute it and/or modify
  14. * it under the terms of the GNU Affero General Public License, version 3,
  15. * as published by the Free Software Foundation.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU Affero General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU Affero General Public License, version 3,
  23. * along with this program. If not, see <http://www.gnu.org/licenses/>
  24. *
  25. */
  26. namespace OCA\Files\Appinfo;
  27. $application = new Application();
  28. $application->registerRoutes(
  29. $this,
  30. array(
  31. 'routes' => array(
  32. array(
  33. 'name' => 'API#getThumbnail',
  34. 'url' => '/api/v1/thumbnail/{x}/{y}/{file}',
  35. 'verb' => 'GET',
  36. 'requirements' => array('file' => '.+')
  37. ),
  38. array(
  39. 'name' => 'API#updateFileTags',
  40. 'url' => '/api/v1/files/{path}',
  41. 'verb' => 'POST',
  42. 'requirements' => array('path' => '.+'),
  43. ),
  44. array(
  45. 'name' => 'API#getFilesByTag',
  46. 'url' => '/api/v1/tags/{tagName}/files',
  47. 'verb' => 'GET',
  48. 'requirements' => array('tagName' => '.+'),
  49. ),
  50. )
  51. )
  52. );
  53. /** @var $this \OC\Route\Router */
  54. $this->create('files_index', '/')
  55. ->actionInclude('files/index.php');
  56. $this->create('files_ajax_delete', 'ajax/delete.php')
  57. ->actionInclude('files/ajax/delete.php');
  58. $this->create('files_ajax_download', 'ajax/download.php')
  59. ->actionInclude('files/ajax/download.php');
  60. $this->create('files_ajax_getstoragestats', 'ajax/getstoragestats.php')
  61. ->actionInclude('files/ajax/getstoragestats.php');
  62. $this->create('files_ajax_list', 'ajax/list.php')
  63. ->actionInclude('files/ajax/list.php');
  64. $this->create('files_ajax_mimeicon', 'ajax/mimeicon.php')
  65. ->actionInclude('files/ajax/mimeicon.php');
  66. $this->create('files_ajax_move', 'ajax/move.php')
  67. ->actionInclude('files/ajax/move.php');
  68. $this->create('files_ajax_newfile', 'ajax/newfile.php')
  69. ->actionInclude('files/ajax/newfile.php');
  70. $this->create('files_ajax_newfolder', 'ajax/newfolder.php')
  71. ->actionInclude('files/ajax/newfolder.php');
  72. $this->create('files_ajax_rename', 'ajax/rename.php')
  73. ->actionInclude('files/ajax/rename.php');
  74. $this->create('files_ajax_scan', 'ajax/scan.php')
  75. ->actionInclude('files/ajax/scan.php');
  76. $this->create('files_ajax_upload', 'ajax/upload.php')
  77. ->actionInclude('files/ajax/upload.php');
  78. $this->create('download', 'download{file}')
  79. ->requirements(array('file' => '.*'))
  80. ->actionInclude('files/download.php');
  81. // Register with the capabilities API
  82. \OC_API::register('get', '/cloud/capabilities', array('OCA\Files\Capabilities', 'getCapabilities'), 'files', \OC_API::USER_AUTH);