[BUGFIX] Copy and move folders between storages is broken
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Classes / Resource / Driver / AbstractDriver.php
index 416ef51..6dacc94 100644 (file)
@@ -524,12 +524,41 @@ abstract class AbstractDriver {
        /**
         * Folder equivalent to copyFileWithinStorage().
         *
-        * @param \TYPO3\CMS\Core\Resource\Folder $folderToMove
+        * @param \TYPO3\CMS\Core\Resource\Folder $folderToCopy
         * @param \TYPO3\CMS\Core\Resource\Folder $targetFolder
         * @param string $newFileName
         * @return boolean
         */
-       abstract public function copyFolderWithinStorage(\TYPO3\CMS\Core\Resource\Folder $folderToMove, \TYPO3\CMS\Core\Resource\Folder $targetFolder, $newFileName);
+       abstract public function copyFolderWithinStorage(\TYPO3\CMS\Core\Resource\Folder $folderToCopy, \TYPO3\CMS\Core\Resource\Folder $targetFolder, $newFileName);
+
+       /**
+        * Move a folder from another storage.
+        *
+        * @param \TYPO3\CMS\Core\Resource\Folder $folderToMove
+        * @param \TYPO3\CMS\Core\Resource\Folder $targetParentFolder
+        * @param string $newFolderName
+        * @throws \BadMethodCallException
+        * @return boolean
+        */
+       public function moveFolderBetweenStorages(\TYPO3\CMS\Core\Resource\Folder $folderToMove, \TYPO3\CMS\Core\Resource\Folder $targetParentFolder, $newFolderName) {
+               // This is not implemented for now as moving files between storages might cause quite some headaches when
+               // something goes wrong. It is also not that common of a use case, so it does not hurt that much to leave it out
+               // for now.
+               throw new \BadMethodCallException('Moving folders between storages is not implemented.');
+       }
+
+       /**
+        * Copy a folder from another storage.
+        *
+        * @param \TYPO3\CMS\Core\Resource\Folder $folderToCopy
+        * @param \TYPO3\CMS\Core\Resource\Folder $targetParentFolder
+        * @param string $newFolderName
+        * @throws \BadMethodCallException
+        * @return boolean
+        */
+       public function copyFolderBetweenStorages(\TYPO3\CMS\Core\Resource\Folder $folderToCopy, \TYPO3\CMS\Core\Resource\Folder $targetParentFolder, $newFolderName) {
+               throw new \BadMethodCallException('Not yet implemented!', 1330262731);
+       }
 
        /**
         * Removes a file from this storage. This does not check if the file is