ISimpleFile.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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\NotPermittedException;
  25. /**
  26. * Interface ISimpleFile
  27. *
  28. * @package OCP\Files\SimpleFS
  29. * @since 11.0.0
  30. * @internal This interface is experimental and might change for NC12
  31. */
  32. interface ISimpleFile {
  33. /**
  34. * Get the name
  35. *
  36. * @return string
  37. * @since 11.0.0
  38. */
  39. public function getName();
  40. /**
  41. * Get the size in bytes
  42. *
  43. * @return int
  44. * @since 11.0.0
  45. */
  46. public function getSize();
  47. /**
  48. * Get the ETag
  49. *
  50. * @return string
  51. * @since 11.0.0
  52. */
  53. public function getETag();
  54. /**
  55. * Get the last modification time
  56. *
  57. * @return int
  58. * @since 11.0.0
  59. */
  60. public function getMTime();
  61. /**
  62. * Get the content
  63. *
  64. * @return string
  65. * @since 11.0.0
  66. */
  67. public function getContent();
  68. /**
  69. * Overwrite the file
  70. *
  71. * @param string $data
  72. * @throws NotPermittedException
  73. * @since 11.0.0
  74. */
  75. public function putContent($data);
  76. /**
  77. * Delete the file
  78. *
  79. * @throws NotPermittedException
  80. * @since 11.0.0
  81. */
  82. public function delete();
  83. /**
  84. * Get the MimeType
  85. *
  86. * @return string
  87. * @since 11.0.0
  88. */
  89. public function getMimeType();
  90. }