Handle Pci asset import

@param $absolutePath
@param $relativePath
@return mixed
439595
public function handle($absolutePath, $relativePath)
    {
        //adapt the file path before comparing them to expected files
        $relativePathAdapted = preg_replace('/^\.\//', '', $relativePath);
        return $this->portableItemParser->importPortableElementFile($absolutePath, $relativePathAdapted);
    }
439457
public function register($name, $path, $absolute = false)
    {
        if($path instanceof \Exedra\Path)
            return $this->pathRegistry[$name] = $path;

        $path = $absolute ? $path : $this->basePath.'/'.ltrim($path, '/\\');

        $this->pathRegistry[$name] = new static($path);

        return $this->pathRegistry[$name];
    }
983495
public function file($path)
	{
		$absolutePath = Asset::isJavascript($path);
		if ($absolutePath) {
			return $this->javascript($absolutePath);
		}

		$absolutePath = Asset::isStylesheet($path);
		if ($absolutePath) {
			return $this->stylesheet($absolutePath);
		}

		$absolutePath = Asset::isFile($path);
		if ($absolutePath)
		{
			$this->clientCacheForFile($absolutePath);
			return new BinaryFileResponse($absolutePath, 200);
		}

		App::abort(404);
	}
1025308
public static function asset($relative_path, $include_version=true) {
    $clean_relative_path = preg_replace('/^[\/_]+/', '', $relative_path);
    return sprintf(
      '%s/_/%s%s',
      THEME_URL,
      $clean_relative_path,
      ($include_version) ? THEME_SUFFIX : null
    );
  }
916216
function importFromBower(relativePath, options) {
    options = options || {};
    app.import(path.join(app.bowerDirectory, relativePath), options);
  }
1315280
public function handle($absolutePath, $relativePath)
    {
        if (!$this->itemSource) {
            throw new \common_Exception('Missing required parameter: item source');
        }

        // store locally, in a safe directory
        $safePath = '';
        if (dirname($relativePath) !== '.') {
            $safePath = str_replace('../', '', dirname($relativePath)) . '/';
        }

        $info = $this->itemSource->add($absolutePath, basename($absolutePath), $safePath);
        \common_Logger::i('Asset file \'' . $absolutePath . '\' copied.');
        return $info;
    }
181297
public function addRelativeLocation($relative_path, array $contents = array())
    {
        $location = $this->newInstance();

        $location->setBasePath($this->base_path.'/'.$relative_path);

        if ($this->base_url) {
            $location->setBaseURL($this->base_url.'/'.$relative_path);
        }

        return $contents ? $location->defineContents($contents) : $location;
    }
495709
public function readFileStream($containerName, $fileName, $relativePath)
    {
        return $this->getFactory()
            ->createStorage($containerName)
            ->readFileStream($containerName, $fileName, $relativePath);
    }
1213678
@Nullable
  static SourceFile getRelativePath(String baseFilePath, String relativePath) {
    return SourceFile.fromPath(
        FileSystems.getDefault().getPath(baseFilePath).resolveSibling(relativePath).normalize(),
        UTF_8);
  }
1192239
public function attachFile($element, $absolutePath)
    {
        $path = ['value' => [$absolutePath]];

        $this->findByNameOrId($element)->postValue($path);

        return $this;
    }
208860
public function registerAutoload($basePath, $prefix = '', $relative = true)
    {
        $path = $relative ? $this->basePath . '/' . $basePath : $basePath;

        Autoloader::getInstance()->registerAutoload($path, $prefix);
    }
1033844
public function holdLock(GitUserInterface $user, FilePath $relativeFilePath)
    {
        return $this->lockService->holdLockForUser($user, $relativeFilePath);
    }
1322860
public function moduleAsset($asset, $module = null, $absolute = false)
    {
        return $this->createAssetPath($asset, $module, $absolute, true);
    }
33173
public function saveUploadedFile($containerName, UploadedFile $file, $relativePath)
    {
        return $this->getFactory()
            ->createStorage($containerName)
            ->saveUploadedFile($containerName, $file, $relativePath);
    }
802694
public function addPath($relativePath)
    {
        if ($relativePath != '/' &&
            is_string($relativePath) &&
            strlen($relativePath) > 0
        ) {
            // Add a leading slash if needed
            if ($relativePath[0] !== '/' &&
                substr($this->path, -1, 1) !== '/'
            ) {
                $relativePath = '/' . $relativePath;
            }

            $this->setPath($this->path . $relativePath);
        }
    }
553394
def _resolve_path(self, container: Container, filepath: str) -> str:
        
        bug = self.__mgr_bug[container.bug]
        filepath_orig = filepath

        if not os.path.isabs(filepath):
            filepath = os.path.join(bug.source_dir, filepath)
            logger.debug("converted relative path to absolute path: %s -> %s",
                         filepath_orig, filepath)

        return filepath
473360
protected function resolveUnsecuredResource($relativePath)
    {
        // Check if the path requested is public-only, but we have no public folder
        $publicOnly = $this->inferPublicResourceRequired($relativePath);
        if ($publicOnly) {
            trigger_error('Requesting a public resource without a public folder has no effect', E_USER_WARNING);
        }

        // Resolve path to base
        $absolutePath = Path::join(Director::baseFolder(), $relativePath);
        $exists = file_exists($absolutePath);

        // Rewrite vendor/ to _resources/ folder
        if (stripos($relativePath, ManifestFileFinder::VENDOR_DIR . DIRECTORY_SEPARATOR) === 0) {
            $relativePath = Path::join(
                RESOURCES_DIR,
                substr($relativePath, strlen(ManifestFileFinder::VENDOR_DIR))
            );
        }
        return [$exists, $absolutePath, $relativePath];
    }