The ResourceStorage accesses the index table sys_file directly via
a call to the $GLOBALS[TYPO3_DB]. The interaction with the sys_file
index table should be managed only by an according repository to
allow changes within that mechanism.
This patch rearranges the factory method to use the according
call within the FileRepository and adapts it, as the FileRepository
will return a file Object instead of an array.
This serves as a preparation for further indexing optimisations,
which need IndexRecords to be handled centrally.