Epic #55070: Workpackages
sysext/core/Resource/Folder::getFiles directly collects the files from the driver (very expensive!) and creates FileObjects directly.
These FileObjects do not know of their index record!
- The driver already provides a method that only returns the existing identifiers instead of extracting the file's data.
- In case the IndexRecord is already present, the method calls ResourceFactory::getFile($uid, $indexRecord) otherwise ResourceFactory::getFileObjectByStorageAndIdentifier() is used.
[BUGFIX] Folder::getFiles directly calls Factory::createFileObject
Folder::getFiles implements the logic of creating file objects
itself, after retrieving the information from the driver.
Besides the fact that this is slow since all information for the
object are received from the filesystem directly instead of the
cache in the sys_file table the uid is not present in these
objects which finally results in the lack of metadata in these
In addition to that ommiting the ResourceFactory several objects
for the same file might exists which may lead to inconsistent
behaviour and output on modifying the file.
As the Folder/File Objects only should be a convinience facade
in front of the ResourceStorage this change introduces a new
method their, implementing the new and improved logic.
At the same time the old functionality - which enforces manual
file object creation - has been deprecated and the filelist
module is adapted accordingly.
Reviewed-by: Frans Saris
Tested-by: Frans Saris
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter