summaryrefslogtreecommitdiffstats
path: root/lib/public
diff options
context:
space:
mode:
authorRoeland Douma <rullzer@users.noreply.github.com>2015-09-06 16:56:35 +0200
committerRoeland Douma <rullzer@users.noreply.github.com>2015-09-06 16:56:35 +0200
commit24f5f50b20c4f49bcd602a3c322f2ee2deb0f95b (patch)
treeb5ba1876566dfa1cc39341e8f58e419bc137d722 /lib/public
parent3642fb701a7fc0caba779de9f5d53bf12c27f5aa (diff)
parentc6314fc699c7316973fa79f75b7d585e620323e9 (diff)
downloadnextcloud-server-24f5f50b20c4f49bcd602a3c322f2ee2deb0f95b.tar.gz
nextcloud-server-24f5f50b20c4f49bcd602a3c322f2ee2deb0f95b.zip
Merge pull request #18742 from owncloud/mimetype-updatedb
Introduce mimetype DB update occ command
Diffstat (limited to 'lib/public')
-rw-r--r--lib/public/files/imimetypeloader.php59
-rw-r--r--lib/public/iservercontainer.php8
2 files changed, 67 insertions, 0 deletions
diff --git a/lib/public/files/imimetypeloader.php b/lib/public/files/imimetypeloader.php
new file mode 100644
index 00000000000..24937ea9b86
--- /dev/null
+++ b/lib/public/files/imimetypeloader.php
@@ -0,0 +1,59 @@
+<?php
+/**
+ * @author Robin McCorkell <rmccorkell@owncloud.com>
+ *
+ * @copyright Copyright (c) 2015, ownCloud, Inc.
+ * @license AGPL-3.0
+ *
+ * This code is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License, version 3,
+ * along with this program. If not, see <http://www.gnu.org/licenses/>
+ *
+ */
+
+namespace OCP\Files;
+
+/**
+ * Interface IMimeTypeLoader
+ * @package OCP\Files
+ * @since 8.2.0
+ *
+ * Interface to load mimetypes
+ **/
+interface IMimeTypeLoader {
+
+ /**
+ * Get a mimetype from its ID
+ *
+ * @param int $id
+ * @return string|null
+ * @since 8.2.0
+ */
+ public function getMimetypeById($id);
+
+ /**
+ * Get a mimetype ID, adding the mimetype to the DB if it does not exist
+ *
+ * @param string $mimetype
+ * @return int
+ * @since 8.2.0
+ */
+ public function getId($mimetype);
+
+ /**
+ * Test if a mimetype exists in the database
+ *
+ * @param string $mimetype
+ * @return bool
+ * @since 8.2.0
+ */
+ public function exists($mimetype);
+}
diff --git a/lib/public/iservercontainer.php b/lib/public/iservercontainer.php
index a6d83156de3..81724cb4967 100644
--- a/lib/public/iservercontainer.php
+++ b/lib/public/iservercontainer.php
@@ -440,6 +440,14 @@ interface IServerContainer {
*/
public function getMimeTypeDetector();
+ /**
+ * Get the MimeTypeLoader
+ *
+ * @return \OCP\Files\IMimeTypeLoader
+ * @since 8.2.0
+ */
+ public function getMimeTypeLoader();
+
/**
* Get the EventDispatcher