public function run()
 {
     $extension = common_ext_ExtensionsManager::singleton()->getExtensionById('taoDelivery');
     $runPath = $extension->getConstant('BASE_PATH') . 'data' . DIRECTORY_SEPARATOR . 'compiled' . DIRECTORY_SEPARATOR;
     helpers_File::emptyDirectory($runPath);
     $runSource = tao_models_classes_FileSourceService::singleton()->addLocalSource('runtimeDirectory', $runPath);
     $provider = new tao_models_classes_fsAccess_TokenAccessProvider($runSource);
     taoDelivery_models_classes_RuntimeAccess::setAccessProvider($provider);
 }
 protected function getCompilationDirectory(core_kernel_classes_Resource $delivery)
 {
     $returnValue = (string) '';
     $fs = taoDelivery_models_classes_RuntimeAccess::getFileSystem();
     $basePath = $fs->getPath();
     $relPath = substr($delivery->getUri(), strpos($delivery->getUri(), '#') + 1) . DIRECTORY_SEPARATOR;
     $absPath = $fs->getPath() . $relPath;
     if (!is_dir($absPath)) {
         if (!mkdir($absPath)) {
             throw new taoDelivery_models_classes_CompilationFailedException('Could not create delivery directory \'' . $absPath . '\'');
         }
     }
     return $fs->createFile('', $relPath);
 }