Reduced complexity of ResourceRepository::getOrCreateDirectory()
Removed unused code