IMimeTypeLoader.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Robin McCorkell <robin@mccorkell.me.uk>
  6. *
  7. * @license AGPL-3.0
  8. *
  9. * This code is free software: you can redistribute it and/or modify
  10. * it under the terms of the GNU Affero General Public License, version 3,
  11. * as published by the Free Software Foundation.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU Affero General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Affero General Public License, version 3,
  19. * along with this program. If not, see <http://www.gnu.org/licenses/>
  20. *
  21. */
  22. namespace OCP\Files;
  23. /**
  24. * Interface IMimeTypeLoader
  25. * @since 8.2.0
  26. *
  27. * Interface to load mimetypes
  28. **/
  29. interface IMimeTypeLoader {
  30. /**
  31. * Get a mimetype from its ID
  32. *
  33. * @param int $id
  34. * @return string|null
  35. * @since 8.2.0
  36. */
  37. public function getMimetypeById($id);
  38. /**
  39. * Get a mimetype ID, adding the mimetype to the DB if it does not exist
  40. *
  41. * @param string $mimetype
  42. * @return int
  43. * @since 8.2.0
  44. */
  45. public function getId($mimetype);
  46. /**
  47. * Test if a mimetype exists in the database
  48. *
  49. * @param string $mimetype
  50. * @return bool
  51. * @since 8.2.0
  52. */
  53. public function exists($mimetype);
  54. /**
  55. * Clear all loaded mimetypes, allow for re-loading
  56. *
  57. * @since 8.2.0
  58. */
  59. public function reset();
  60. }