Converts url path to the Transloadit full url.
Returns the url passed if it is already full.

@param url
@return String
515152
private String getFullUrl(String url) {
        return url.startsWith("https://") || url.startsWith("http://") ? url : transloadit.getHostUrl() + url;
    }
825008
protected function _convertCatenateUrl($url)
    {
        $e = $part = null;
        $url = new Horde_Imap_Client_Url_Imap($url);

        if (!is_null($url->mailbox) && !is_null($url->uid)) {
            try {
                $status_res = is_null($url->uidvalidity)
                    ? null
                    : $this->status($url->mailbox, Horde_Imap_Client::STATUS_UIDVALIDITY);

                if (is_null($status_res) ||
                    ($status_res['uidvalidity'] == $url->uidvalidity)) {
                    if (!isset($this->_temp['catenate_ob'])) {
                        $this->_temp['catenate_ob'] = new Horde_Imap_Client_Socket_Catenate($this);
                    }
                    $part = $this->_temp['catenate_ob']->fetchFromUrl($url);
                }
            } catch (Horde_Imap_Client_Exception $e) {}
        }

        if (is_null($part)) {
            $message = 'Bad IMAP URL given in CATENATE data: ' . strval($url);
            if ($e) {
                $message .= ' ' . $e->getMessage();
            }

            throw new InvalidArgumentException($message);
        }

        return $part;
    }
783931
protected function parseUrl($url)
    {
        if ($parsed = parse_url($url)) {
            return $this->addPassword($parsed);
        }

        // A second try for not file:// schemes which does support absolute
        // paths (like sqlite:///)

        // Cut the scheme by hand
        $parts = explode(':', $url, 2);

        if (count($parts) != 2 || strlen($parts[0]) > 24) {
            throw new InvalidArgumentException("Unparseable url $url");
        }

        // Now cheat parse_url by giving it a file url
        if (!$parsed = parse_url('file:'.$parts[1])) {
            throw new InvalidArgumentException("Unparseable url $url");
        }

        $parsed['scheme'] = $parts[0];

        return $this->addPassword($parsed);
    }
1357338
public static String getRootRelativePath(String url) {

		Matcher matcher = URL_SEPARATOR_PATTERN.matcher(url);
		StringBuffer result = new StringBuffer();
		boolean first = true;
		while (matcher.find()) {
			if (first) {
				matcher.appendReplacement(result, "");
				first = false;
			} else {
				matcher.appendReplacement(result, ROOT_REPLACE_PATTERN);
			}
		}

		return result.toString();
	}
264568
private String getPath(URL url) {
		String path = url.toExternalForm();
		return path.replaceAll("bundle://[^/]*/", "");
	}
457553
def full_path(self, *args, **query):
        """"""
        path = None
        if args:
            if len(args) > 1:
                raise TypeError("full_url() takes exactly 1 argument "
                                "(%s given)" % len(args))
            path = args[0]
        if not path:
            path = self.path
        elif not path.startswith('/'):
            path = remove_double_slash('%s/%s' % (self.path, path))
        return iri_to_uri(path, query)
1219425
public String applyOnURL(String url) {
        if (StringUtils.isBlank(url)) {
            return url;
        }
        return StringUtils.substringBefore(url, "?") + toString();
    }
394755
public static String getProtocol(String url)
  {
    if(url == null) {
      return null;
    }
    int protocolSeparatorIndex = url.indexOf("://");
    if(protocolSeparatorIndex == -1) {
      return null;
    }
    return url.substring(0, protocolSeparatorIndex).toLowerCase();
  }
357511
public function internalize($url = '')
    {

        //Are we dealing with an array of parts?
        if (is_array($url)) {
            $url = implode('/', $url);
        }

        //@TODO make sure that this url does not have the scheme
        if (preg_match('|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $url))
            return $url;
        //@TODO make sure that this url does not have the host already
        //@TODO make sure we are internalizing a path and nothing else
        //die;
        //Do we have the path info included?
        $sPath = $this->request->getBasePath() . "/";


        if (!empty($url) && $sPath <> "/") {

            $parts = explode("/", $sPath);
            $segments = explode("/", $url);

            //Remove all empty elements
            $segments = array_filter($segments, 'strlen');
            $parts = array_filter($parts, 'strlen');
            //die;
            //This is in case we have a system deep in multiple supdirectories
            array_unshift($parts, null);
            $fragment = implode("/", $parts);

            if (is_array($segments)) {

                array_unshift($segments, null); //Adds the / to the start of the url
                $url = implode("/", $segments);

                //now look for $fragment at the start of $url
                $pos = strpos($url, $fragment);
                if ($pos !== 0 || $pos === FALSE) {
                    $url = $fragment . $url;
                }
            }
        }
        return $url;
    }
1106654
public static String getHostFromURL(String url) {
		URL u = toURL(url);
		String host = (u == null) ? "" : u.getHost();
		return host;
	}
230502
private URL getUrl() {
        ClassLoader loader = null;
        try {
            loader = Thread.currentThread().getContextClassLoader();
        } catch (Exception e) {
            // do nothing
        }

        if (loader == null) {
            loader = ClassPathResource.class.getClassLoader();
        }

        URL url = loader.getResource(this.resourceName);
        if (url == null) {
            // try to check for mis-used starting slash
            // TODO: see TODO below
            if (this.resourceName.startsWith("/")) {
                url = loader.getResource(this.resourceName.replaceFirst("[\\\\/]", ""));
                if (url != null)
                    return url;
            } else {
                // try to add slash, to make clear it's not an issue
                // TODO: change this mechanic to actual path purifier
                url = loader.getResource("/" + this.resourceName);
                if (url != null)
                    return url;
            }
            throw new IllegalStateException("Resource '" + this.resourceName + "' cannot be found.");
        }
        return url;
    }
1196070
public function to($url)
    {
        if ($url == '/' && $this->getRoot() == $url) {
            return $url;
        }

        return $this->isValidUrl($url) ? $url : $this->generateUrl($url);
    }
152643
public function processUrl($url)
    {
        if (strpos($url, '::') !== false) {
            list($folder, $asset) = explode('::', $url, 2);
        } else {
            $folder = null;
            $asset = $url;
        }

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

        return array(
            'folder' => $folder,
            'asset' => $asset
        );
    }
951440
public function getAbsolute($url)
    {
        if (empty($url)) {
            return '';
        }

        if (strpos($url, 'data:') === 0) {
            return $url;
        }

        if (preg_match('|^\w+://|', $url)) {
            return $url;
        }

        if (strpos($url, '://') === 0) {
            return $this->getScheme().$url;
        }

        if (strpos($url, '//') === 0) {
            return $this->getScheme().":$url";
        }

        if ($url[0] === '/') {
            return $this->getScheme().'://'.$this->getHost().$url;
        }

        return $this->getScheme().'://'.$this->getHost().$this->getDirectories().$url;
    }
1231457
public static function path(string $url): string
    {
        // remove line feeds and trailing whitespaces and path separators
        $path = trim($url, " \t\r\n\0\x0B/\\");
        $path = substr($path, strlen(self::SCHEME . '://'));
        $path = str_replace('\\', '/', $path);
        // replace double slashes with single slashes
        $path = str_replace('//', '/', $path);
        return rawurldecode($path);
    }
241502
public function getUrl($url, $size = "thumb", $fullUrl = false)
    {
        // Get default dimensions
        $defaultDimensions = Config::get('redminportal::image.dimensions');
        
        // Get upload path
        $upload_path = Config::get('redminportal::image.upload_path');

        $dimension = $defaultDimensions[$size];

        // Get dimmensions and quality
        $width   = (int) $dimension[0];
        $height  = isset($dimension[1]) ?  (int) $dimension[1] : $width;
        $crop    = isset($dimension[2]) ? (bool) $dimension[2] : false;

        // URL info
        $info = pathinfo($url);

        // The size
        if (! $height) {
            $height = $width;
        }

        // Directories and file names
        $fileName       = $info['basename'];
        $targetDirName  = $width . 'x' . $height . ($crop ? '_crop' : '');
        $targetUrl      = RHelper::joinPaths($upload_path . $info['dirname'], $targetDirName, $fileName);
        $relativeUrl    = RHelper::joinPaths($info['dirname'], $targetDirName, $fileName);

        return ($fullUrl ? $targetUrl : $relativeUrl);
    }
486871
def full_path(self):
        """"""
        return self.path + u'?' + to_unicode(self.query_string, self.url_charset)