/**
* Method that takes a file path and converts it to a relative path
*
* @param string $path The actual path of the file
*
* @return string The relative path of the file
*
* @since 4.0.0
*/
protected static function convertToRelativePath($path)
{
$relativeFilePath = Uri::root(true) . str_replace(JPATH_ROOT, '', $path);
// On windows devices we need to replace "\" with "/" otherwise some browsers will not load the asset
return str_replace(DIRECTORY_SEPARATOR, '/', $relativeFilePath);
}