public function downloadFile($fileUri, $locale = '', DownloadFileParameters $params = null)
    {
        if ((!is_string($locale)) || strlen($locale) < 2) {
            $message = vsprintf(
                'Invalid locale value got. Expected a string of at least 2 chars length, but got: %s',
                [
                    '' === $locale ? 'Empty string' : var_export($locale, true)
                ]
            );

            throw new SmartlingApiException($message);
        }

        $params = (is_null($params)) ? [] : $params->exportToArray();
        $params['fileUri'] = $fileUri;

        $requestData = $this->getDefaultRequestData('query', $params);
        unset($requestData['headers']['Accept']);

        return $this->sendRequest("locales/{$locale}/file", $requestData, self::HTTP_METHOD_GET, true);
    }
public function downloadFile($fileUri, $locale = '', DownloadFileParameters $params = null)
    {
        if ((!is_string($locale)) || strlen($locale) < 2) {
            $message = vsprintf(
                'Invalid locale value got. Expected a string of at least 2 chars length, but got: %s',
                [
                    '' === $locale ? 'Empty string' : var_export($locale, true)
                ]
            );

            throw new SmartlingApiException($message);
        }

        $params = (is_null($params)) ? [] : $params->exportToArray();
        $params['fileUri'] = $fileUri;

        $requestData = $this->getDefaultRequestData('query', $params);
        unset($requestData['headers']['Accept']);

        return $this->sendRequest("locales/{$locale}/file", $requestData, self::HTTP_METHOD_GET, true);
    }
public function downloadFile ( $ fileUri , $ locale = '' , DownloadFileParameters $ params = null ) { if ( ( ! is_string ( $ locale ) ) || strlen ( $ locale ) < 2 ) { $ message = vsprintf ( 'Invalid locale value got. Expected a string of at least 2 chars length, but got: %s' , [ '' === $ locale ? 'Empty string' : var_export ( $ locale , true ) ] ) ; throw new SmartlingApiException ( $ message ) ; } $ params = ( is_null ( $ params ) ) ? [ ] : $ params -> exportToArray ( ) ; $ params [ 'fileUri' ] = $ fileUri ; $ requestData = $ this -> getDefaultRequestData ( 'query' , $ params ) ; unset ( $ requestData [ 'headers' ] [ 'Accept' ] ) ; return $ this -> sendRequest ( "locales/{$locale}/file" , $ requestData , self :: HTTP_METHOD_GET , true ) ; }
Downloads the requested file from Smartling.

It is important to check the HTTP response status code. If Smartling finds
and returns the file normally, you will receive a 200 SUCCESS response.
If you receive any other response status code than 200, the requested
file will not be part of the response.

@param string $fileUri
Value that uniquely identifies the downloaded file.
@param string $locale
A locale identifier as specified in project setup. If no locale
is specified, original content is returned.
@param DownloadFileParameters $params
(optional) An associative array of additional options, with the following
elements:
- 'retrievalType': Determines the desired format for the download. Could
be one of following values:
pending|published|pseudo|contextMatchingInstrumented
- 'includeOriginalStrings': Boolean that specifies whether Smartling will
return the original string or an empty string where no translation
is available.

@return string
File content.

@throws \Smartling\Exceptions\SmartlingApiException

@see http://docs.smartling.com/pages/API/FileAPI/Download-File/
Downloads the requested file from Smartling .