ISimpleFolder.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016 Roeland Jago Douma <roeland@famdouma.nl>
  4. *
  5. * @author Roeland Jago Douma <roeland@famdouma.nl>
  6. *
  7. * @license GNU AGPL version 3 or any later version
  8. *
  9. * This program is free software: you can redistribute it and/or modify
  10. * it under the terms of the GNU Affero General Public License as
  11. * published by the Free Software Foundation, either version 3 of the
  12. * License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU Affero General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Affero General Public License
  20. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  21. *
  22. */
  23. namespace OCP\Files\SimpleFS;
  24. use OCP\Files\NotFoundException;
  25. use OCP\Files\NotPermittedException;
  26. /**
  27. * Interface ISimpleFolder
  28. *
  29. * @package OCP\Files\SimpleFS
  30. * @since 11.0.0
  31. */
  32. interface ISimpleFolder {
  33. /**
  34. * Get all the files in a folder
  35. *
  36. * @return ISimpleFile[]
  37. * @since 11.0.0
  38. */
  39. public function getDirectoryListing();
  40. /**
  41. * Check if a file with $name exists
  42. *
  43. * @param string $name
  44. * @return bool
  45. * @since 11.0.0
  46. */
  47. public function fileExists($name);
  48. /**
  49. * Get the file named $name from the folder
  50. *
  51. * @param string $name
  52. * @return ISimpleFile
  53. * @throws NotFoundException
  54. * @since 11.0.0
  55. */
  56. public function getFile($name);
  57. /**
  58. * Creates a new file with $name in the folder
  59. *
  60. * @param string $name
  61. * @return ISimpleFile
  62. * @throws NotPermittedException
  63. * @since 11.0.0
  64. */
  65. public function newFile($name);
  66. /**
  67. * Remove the folder and all the files in it
  68. *
  69. * @throws NotPermittedException
  70. * @since 11.0.0
  71. */
  72. public function delete();
  73. /**
  74. * Get the folder name
  75. *
  76. * @return string
  77. * @since 11.0.0
  78. */
  79. public function getName();
  80. }