Build uri.

@param string $remoteImage Name of the image.
@param string $remoteFolder Name of the folder.
@param string $readType Type to read barcode.

@return string
968702
public function uriBuilder($remoteImage, $remoteFolder, $readType)
    {
        $uri = Product::$baseProductUri . '/barcode/';
        if ($remoteImage != null)
            $uri .= $remoteImage . '/';
        $uri .= 'recognize?';
        if ($readType == 'AllSupportedTypes')
            $uri .= 'type=';
        else
            $uri .= 'type=' . $readType;
        if ($remoteFolder != null && trim($remoteFolder) === '')
            $uri .= '&format=' . $remoteFolder;
        if ($remoteFolder != null && trim($remoteFolder) === '')
            $uri .= '&folder=' . $remoteFolder;
        return $uri;
    }
131809
public function upload(String $localPath, String $remotePath, String $type = 'ascii') : Bool
    {
        if( ftp_put($this->connect, $remotePath, $localPath, Helper::toConstant($type, 'FTP_')) )
        {
            return true;
        }
        else
        {
            throw new FileRemoteUploadException($localPath);
        }
    }
1326259
static function remoteXpathQuery($url, $xpath, array $post = []) {
		if (count($post) > 0) {
			$cont = self::postRequest($url, $post);
		} else {
			$cont = file_get_contents($url);
		}
		return self::xpathQuery($cont, $xpath);
	}
867109
public function get_remote_api_readme( $git, $request ) {
		if ( ! $this->local_file_exists( 'readme.txt' ) ) {
			return false;
		}

		$response = isset( $this->response['readme'] ) ? $this->response['readme'] : false;

		// Set $response from local file if no update available.
		if ( ! $response && ! $this->can_update_repo( $this->type ) ) {
			$response = $this->get_local_info( $this->type, 'readme.txt' );
		}

		if ( ! $response ) {
			self::$method = 'readme';
			$response     = $this->api( $request );
			$response     = $this->decode_response( $git, $response );
		}

		if ( ! $response && ! is_wp_error( $response ) ) {
			$response          = new \stdClass();
			$response->message = 'No readme found';
		}

		if ( $this->validate_response( $response ) ) {
			return false;
		}

		if ( $response && ! isset( $this->response['readme'] ) ) {
			$parser   = new Readme_Parser( $response );
			$response = $parser->parse_data();
			$this->set_repo_cache( 'readme', $response );
		}

		$this->set_readme_info( $response );

		return true;
	}
721537
public static ImageReader getImageReaderFromHttpImage(final String sourceImageHttpURL)
            throws IOException {

        InputStream inputStream = new URL(sourceImageHttpURL).openConnection().getInputStream();
        return getImageReader(inputStream);
    }
1064116
function fetch_remote_icon_url() {
            $info = $this->fetch_module_info();

            return ( $this->is_api_result_object( $info, 'icon' ) && is_string( $info->icon ) ) ?
                $info->icon :
                '';
        }
17115
public final void addRemoteRepository(String id, String type, String url) {
        if (this.repositoryIds.add(id) ) {
            getRemoteRepositories().add(new RemoteRepository(id, type, url));
        }
    }
1011804
private byte[] readImage(String uriWithParams) {

        try {
            String pathAndQuery = OpenCms.getLinkManager().getRootPath(m_cms, uriWithParams);
            URI uri = new URI(pathAndQuery);
            String path = uri.getPath();
            String query = uri.getQuery();
            String scaleParams = null;
            if (query != null) {
                Matcher matcher = SCALE_PARAMS_PATTERN.matcher(query);
                if (matcher.find()) {
                    scaleParams = matcher.group(1);
                }
            }
            CmsFile imageFile = m_rootCms.readFile(path);
            byte[] result = imageFile.getContents();
            if (scaleParams != null) {
                CmsImageScaler scaler = new CmsImageScaler(scaleParams);
                result = scaler.scaleImage(imageFile);
            }
            return result;
        } catch (Exception e) {
            LOG.error("Problem with reading image " + uriWithParams + ": " + e.getLocalizedMessage(), e);
            return null;
        }
    }
107715
private function download(RemotePackageEntity $remotePackage)
    {
        $temp = $this->app->make(VolatileDirectory::class);
        /* @var VolatileDirectory $temp */
        $zipFilename = $temp->getPath() . '/downloaded.zip';
        $this->httpClient->reset();
        $this->httpClient->setOptions([
            'storeresponse' => false,
            'outputstream' => $zipFilename,
        ]);
        $request = new Request();

        if (($header = (string) getenv('CT_REMOTEPACKAGE_HEADER')) &&
            $value = (string) getenv('CT_REMOTEPACKAGE_HEADER_VALUE')) {
            $request->getHeaders()->addHeaderLine($header, $value);
        }
        $request->setMethod('GET')->setUri($remotePackage->getArchiveUrl());
        $response = $this->httpClient->send($request);
        $this->httpClient->reset();
        $streamHandle = ($response instanceof \Zend\Http\Response\Stream) ? $response->getStream() : null;
        if (is_resource($streamHandle)) {
            fclose($streamHandle);
        }
        if ($response->getStatusCode() != 200) {
            $error = t('Failed to download package archive %s v%s: %s (%d)', $remotePackage->getHandle(), $remotePackage->getVersion(), $response->getReasonPhrase(), $response->getStatusCode());
            unset($temp);
            throw new DownloadException($error, $response->getStatusCode());
        }

        $contentEncodingHeader = $response->getHeaders()->get('Content-Encoding');
        if (!empty($contentEncodingHeader)) {
            $contentEncoding = trim((string) $contentEncodingHeader->getFieldValue());
            if ($contentEncoding !== '') {
                $decodedZipFilename = $temp->getPath() . '/downloaded-decoded.zip';
                switch (strtolower($contentEncoding)) {
                    case 'gzip':
                        $this->decodeGzip($zipFilename, $decodedZipFilename);
                        break;
                    case 'deflate':
                        $this->decodeDeflate($zipFilename, $decodedZipFilename);
                        break;
                    case 'plainbinary':
                    default:
                        $decodedZipFilename = '';
                        break;
                }
                if ($decodedZipFilename !== '') {
                    $temp->getFilesystem()->delete([$zipFilename]);
                    $zipFilename = $decodedZipFilename;
                }
            }
        }

        $temp->getFilesystem()->makeDirectory($temp->getPath() . '/unzipped');
        $this->zip->unzip($zipFilename, $temp->getPath() . '/unzipped');
        $temp->getFilesystem()->delete([$zipFilename]);

        return $temp;
    }
1162543
public function getLoginUrl($redirect_uri, $scopes = array("read_public"), $response_type = "code")
    {
        $queryparams = array(
            "response_type"     => $response_type,
            "redirect_uri"      => $redirect_uri,
            "client_id"         => $this->client_id,
            "client_secret"     => $this->client_secret,
            "scope"             => implode(",", $scopes),
            "state"             => $this->state
        );

        // Build url and return it
        return sprintf("%s?%s", self::AUTH_HOST, http_build_query($queryparams));
    }
903056
public void addRemoteRepositoryByUrl(String url, String username, String password) throws URLException {
        RemoteRepository remoteRepo;
        try {
            remoteRepo = RepoBuilder.remoteRepositoryFromUrl(url);
        } catch (MalformedURLException e) {
            throw new URLException(e);
        }
        remoteRepo = remoteRepo.setAuthentication(new Authentication(username, password));
        addRemoteRepository(remoteRepo);
    }
1236454
private String createRemoteRequestURI(HttpServletRequest pRequest) {
        StringBuilder requestURI = new StringBuilder(remotePath);
        requestURI.append(pRequest.getPathInfo());

        if (!StringUtil.isEmpty(pRequest.getQueryString())) {
            requestURI.append("?");
            requestURI.append(pRequest.getQueryString());
        }

        return requestURI.toString();
    }
1180605
public function read($uri, $mimeType = null)
    {
        if (!$uri instanceof UriInterface) {
            $uri = $this->uriFactory()->create($uri);
        }

        $content = $this->loader()->load($uri);
        if (null === $mimeType) {
            $mimeType = $content->mimeType();
        }

        $value = $this->protocolMap()->get($mimeType)->thaw($content->data());

        return $this->valueFactory()->create($value);
    }
156728
public static function buildQuery($data, String $numericPrefix = NULL, String $separator = NULL, Int $enctype = PHP_QUERY_RFC1738) : String
    {
        return http_build_query($data, $numericPrefix, $separator ?? '&', $enctype);
    }
1185619
def make_remote_image_result(annotations=None, labels=None):
        """"""
        return BuildResult(image_id=BuildResult.REMOTE_IMAGE,
                           annotations=annotations, labels=labels)
785483
public function getReader($reInitiate = false) : ReaderInterface
    {
        if ($reInitiate === true || $this->reader === null) {
            $directory = $this->getDataDirectory();

            if (!$this->isDirectoryReadable($directory)) {
                throw new ParserConfigurationException("Directory '$directory' is not readable.", 1458974128);
            }

            $this->reader = new Reader($directory);
            $this->reader->setPropertyFilter($this->getPropertyFilter());
            $this->reader->setDataVersionHash($this->getDataVersionHash());
        }

        return $this->reader;
    }
155341
public GenericDraweeHierarchyBuilder setRetryImage(
      int resourceId, @Nullable ScalingUtils.ScaleType retryImageScaleType) {
    mRetryImage = mResources.getDrawable(resourceId);
    mRetryImageScaleType = retryImageScaleType;
    return this;
  }