Issue Feature Closed

#62830Improved folder moving/copying

Christian Opitz 11/10/14, 16:29 updated 09/01/23, 08:18

Description

The methods for moving and copying in TYPO3\CMS\Core\Resource\ResourceStorage require several improvements:
  1. Implement moving and copying folders between storages
  2. Implement conflict handling for moving and copying folders
    • renameNewFolder would generate another name for the target folder, when it already exists at target parent
    • renameNewFile would add new directories and add the files with new names, when they already exist
    • integrate would add new directories and overwrite existing files
    • cancel would cancel
  3. Implement a way to allow custom drivers to import files from other drivers/storages rather than forcing it to add a local copy (see thread on mailing list for upfront discussions):
    Will provide an TYPO3\CMS\Core\Resource\Driver\ImportableDriverInterface with importFile(\TYPO3\CMS\Core\Resource\FileInterface $file, $targetFolderIdentifier, $newFileName = null, $removeOriginal = TRUE). When the driver implements this interface, this method instead of addFile() will be called in ResourceStorage::moveFile() and ResourceStorage::copyFile()
  4. Allow to moveFile/moveFolder without removing the source file (usefull for migrations between two different drivers)
  5. Create functional tests for the move and copy methods

Reviews 1