diff --git a/lib/private/Files/Cache/AbstractCacheEvent.php b/lib/private/Files/Cache/AbstractCacheEvent.php
index 0fd03779009304e1c558269341299234464bafbf..741c06f349034bffa0cfae2aee4a66eb7dbd5427 100644
--- a/lib/private/Files/Cache/AbstractCacheEvent.php
+++ b/lib/private/Files/Cache/AbstractCacheEvent.php
@@ -64,6 +64,14 @@ class AbstractCacheEvent extends Event implements ICacheEvent {
 		return $this->path;
 	}
 
+	/**
+	 * @param string $path
+	 * @since 19.0.0
+	 */
+	public function setPath(string $path): void {
+		$this->path = $path;
+	}
+
 	/**
 	 * @return int
 	 * @since 16.0.0
diff --git a/lib/public/Files/Cache/ICacheEvent.php b/lib/public/Files/Cache/ICacheEvent.php
index c075d65564e5db30dfd2c5f7bd81540cc5987608..54ef15b03922e99f2d3c65dd2e2dcd6512280f18 100644
--- a/lib/public/Files/Cache/ICacheEvent.php
+++ b/lib/public/Files/Cache/ICacheEvent.php
@@ -44,6 +44,12 @@ interface ICacheEvent {
 	 */
 	public function getPath(): string;
 
+	/**
+	 * @param string $path
+	 * @since 19.0.0
+	 */
+	public function setPath(string $path): void;
+
 	/**
 	 * @return int
 	 * @since 16.0.0