Thanks to the enum it shouldn't be possible for there to be a bad repository type passed as an argument to this method, but this will handle it just in case.
An easy way to hook up various file storage mechanisms, following the repository pattern with a factory.