aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2019-12-12 11:19:55 +0100
committerGitHub <noreply@github.com>2019-12-12 11:19:55 +0100
commitc6e51924c8615166c2533f83ecc6399d9cc56cbd (patch)
tree4628e29811b1b3b5831df2b18cafedbc2e7ee86b /lib/public
parent4f60609f83fde059e6f831c1b17b481e6604ce24 (diff)
parent4356c91ffd16f54a7bc67b7c62ef4f1110b29e9f (diff)
downloadnextcloud-server-c6e51924c8615166c2533f83ecc6399d9cc56cbd.tar.gz
nextcloud-server-c6e51924c8615166c2533f83ecc6399d9cc56cbd.zip
Merge pull request #18236 from nextcloud/bugfix/noid/always-detect-mimetype-by-content-in-workflows
Allow to detect mimetype by content
Diffstat (limited to 'lib/public')
-rw-r--r--lib/public/Files/IMimeTypeDetector.php10
-rw-r--r--lib/public/WorkflowEngine/IFileCheck.php5
2 files changed, 13 insertions, 2 deletions
diff --git a/lib/public/Files/IMimeTypeDetector.php b/lib/public/Files/IMimeTypeDetector.php
index 3d26860c744..3686405b529 100644
--- a/lib/public/Files/IMimeTypeDetector.php
+++ b/lib/public/Files/IMimeTypeDetector.php
@@ -40,10 +40,18 @@ interface IMimeTypeDetector {
* @param string $path
* @return string
* @since 8.2.0
- **/
+ */
public function detectPath($path);
/**
+ * detect mimetype only based on the content of file
+ * @param string $path
+ * @return string
+ * @since 18.0.0
+ */
+ public function detectContent(string $path): string;
+
+ /**
* detect mimetype based on both filename and content
*
* @param string $path
diff --git a/lib/public/WorkflowEngine/IFileCheck.php b/lib/public/WorkflowEngine/IFileCheck.php
index 07626a0071d..546b72fa2dc 100644
--- a/lib/public/WorkflowEngine/IFileCheck.php
+++ b/lib/public/WorkflowEngine/IFileCheck.php
@@ -37,8 +37,11 @@ use OCP\Files\Storage\IStorage;
*/
interface IFileCheck extends IEntityCheck {
/**
+ * @param IStorage $storage
+ * @param string $path
+ * @param bool $isDir
* @since 18.0.0
*/
- public function setFileInfo(IStorage $storage, string $path);
+ public function setFileInfo(IStorage $storage, string $path, bool $isDir = false): void;
}