From 77cd7560a5392a28f6a496fc1a2a360eda256af1 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 8 Apr 2024 14:55:49 +0200 Subject: add a seperate storage method to distinguish between 'path exists' and 'path is available' Signed-off-by: Robin Appelman --- lib/private/Files/Storage/Storage.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lib/private/Files/Storage/Storage.php') diff --git a/lib/private/Files/Storage/Storage.php b/lib/private/Files/Storage/Storage.php index 0a2511de164..040de66afe2 100644 --- a/lib/private/Files/Storage/Storage.php +++ b/lib/private/Files/Storage/Storage.php @@ -136,4 +136,16 @@ interface Storage extends \OCP\Files\Storage { * - permissions */ public function getDirectoryContent($directory): \Traversable; + + /** + * Check if a filepath is available/unused + * + * This is usually the inverse of `file_exists` but some filesystems might have additional restrictions for + * which file names are available. + * For example with case-insensitive filesystems where names that only differ by case would conflict. + * + * @param string $path + * @return bool + */ + public function pathAvailable(string $path): bool; } -- cgit v1.2.3