Creates a file URL from a path
@param string $path
@param bool $absolute
@return string
160116
public function file($path, $absolute = false)
    {
        return $this->get('files/' . trim($path, '/'), array(), $absolute, true);
    }
179969
public function makePathAbsolute($path = '')
    {
        if (empty($path) === false) {
            return DIRECTORY_SEPARATOR . trim(DirectoryKeys::realpath($path), DIRECTORY_SEPARATOR);
        }
    }
921552
public function baseURL($path = '')
    {
        if (is_null($this->baseURL)) {
            $self = $_SERVER['PHP_SELF'];
            $server = $_SERVER['HTTP_HOST']
                      . rtrim(str_replace(strstr($self, 'index.php'), '', $self), '/');

            if ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off')
                || !empty($_SERVER['HTTP_X_FORWARDED_PROTO'])
                && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https'
            ) {
                $protocol = 'https://';
            } else {
                $protocol = 'http://';
            }

            $this->baseURL = $protocol . $server;
        }

        $url = $this->baseURL;

        if ($path !== '') {
            $url .= '/' . $path;
        }

        return $url;
    }
740917
protected function makePath($path)
    {
        $path = $this->fs->isAbsolutePath($path)
            ? $path
            : base_path($path);
        return Paths::fix($path);
    }
1121172
public function getNextUrl($absolute = false)
    {
        return $this->hasNext() ? $this->getUrl($this->getNext(), $absolute) : null;
    }
448610
public function getFile(FilePath $path)
    {
        $absolutePath = $this->gitService->getAbsolutePath($path);

        return new File($absolutePath->toAbsoluteString(DIRECTORY_SEPARATOR));
    }
164356
public function createPath($base, $path)
    {
        if (!is_dir($base) || !is_writable($base)) {
            return false;
        }

        if (empty($path)) {
            return false;
        }

        $pieces = explode(self::DS, $path);
        $dir = $base;
        foreach ($pieces as $directory) {
            if (empty($directory)) {
                // @codeCoverageIgnoreStart
                continue; // Handle the / from the exploded path
                // @codeCoverageIgnoreEnd
            }

            $singlePath = $dir . self::DS . $directory;
            if (!file_exists($singlePath) || !is_dir($singlePath)) {
                $create = @mkdir($singlePath);
                if ($create === false) {
                    // @codeCoverageIgnoreStart
                    return false;
                    // @codeCoverageIgnoreEnd
                }
            }
            $dir = $singlePath;
        }

        return true;
    }
1275327
def get_absolute_path(self, path):
        '''
        
        '''
        if os.path.isabs(path):
            return path
        else:
            return os.path.abspath(os.path.join(self.config.BASEDIR, path))
22415
public function getUrl($path)
    {
        if ($this->publish($path)) {
            $obj = $this->getFileObject($path);
            if ($url = $obj->getWebContentLink()) {
                return str_replace('export=download', 'export=media', $url);
            }
            if ($url = $obj->getWebViewLink()) {
                return $url;
            }
        }
        return false;
    }
373116
private function createFilePath($path)
    {
        $dir = dirname($path);
        return file_exists($dir) || FileHelper::createDirectory($dir, 0775, true);
    }
121907
public function get($path = '', $options = array(), $absolute = false, $nolangcode = false)
    {
        $pass_absolute = false;

        if (!empty($path)) {
            if ($absolute && $this->isAbsolute($path)) {
                $url = $path;
                $pass_absolute = true;
            } else {
                $url = $this->request->base($nolangcode) . trim($path, '/');
            }
        } else {
            $url = $this->server->requestUri();
        }

        $url = strtok($url, '?');

        if ($absolute && !$pass_absolute) {
            $url = $this->server->httpScheme() . $this->server->httpHost() . $url;
        }

        $url = empty($options) ? $url : "$url?" . http_build_query($options);

        return filter_var($url, FILTER_SANITIZE_URL);
    }
816636
public function getInitialPath($absolute = false)
    {
        $path = $this->module->getSettings('file_manager', 'initial_path');
        return $absolute ? gplcart_file_absolute($path) : $path;
    }
660822
private function makeSurePathIsAbsolute($path)
    {
        $baseUrl = rtrim($this->getParameter('base_url'), '/').'/';

        return 0 !== strpos($path, 'http') ? $baseUrl.ltrim($path, '/') : $path;
    }
970519
function convert_absolute_path_to_url( $absolute_path ) {

        // Remove WordPress installation path from file path.
        $file_base = str_replace( ABSPATH, '', $absolute_path );

        // Add site url to file base.
        $file_url = trailingslashit( site_url() ) . $file_base;

        return $file_url;

    }
200025
public function createFile(string $path): File {
    $localFile = $this->instantiateFile($path);
    $localFile->create();
    return $localFile;
  }
830308
public function abs_url($str, $search_path = false)
    {
        if ($str[0] == '/') {
            if ($search_path && ($file_url = $this->get_skin_file($str, $skin_path))) {
                return $file_url;
            }

            return $this->base_path . $str;
        }

        return $str;
    }
209192
public function getFilePath($field, $absolute = false)
    {
        if (empty($this->$field) || is_file($this->$field)) {
            return $this->$field;
        }

        return $this->getUploadPath($absolute).$this->$field;
    }