\Iqrf\Repository\ModelsFilesManager

Files manager

Summary

Methods
Properties
Constants
__construct()
setPath()
setUseCredentials()
download()
get()
list()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$httpClient
$useCredentials
N/A

Properties

$httpClient

$httpClient : \Iqrf\Repository\Utils\FileClient

Type

FileClient — HTTP(S) file client

$useCredentials

$useCredentials : bool

Type

bool — Use credentials

Methods

__construct()

__construct(\Iqrf\Repository\Utils\FileClient  $httpClient) : mixed

Constructor

Parameters

\Iqrf\Repository\Utils\FileClient $httpClient

HTTP(S) file client

Returns

mixed —

setPath()

setPath(string  $path) : void

Sets the base path

Parameters

string $path

Base path

setUseCredentials()

setUseCredentials(bool  $useCredentials) : void

Stets the credentials usage

Parameters

bool $useCredentials

Use credentials

download()

download(string  $fileName) : string|null

Download the file and returns its content

Parameters

string $fileName

File name

Throws

\Iqrf\Repository\Exceptions\DataNotFound
\Iqrf\Repository\Exceptions\ServiceUnavailable

Returns

string|null —

File content

get()

get(string  $fileName) : \Iqrf\Repository\Entities\File|null

Return the file entity

Parameters

string $fileName

File name

Throws

\Iqrf\Repository\Exceptions\DataNotFound
\Nette\Utils\JsonException
\Iqrf\Repository\Exceptions\ServiceUnavailable

Returns

\Iqrf\Repository\Entities\File|null —

File

list()

list() : \Iqrf\Repository\Entities\Files

Lists files

Throws

\Iqrf\Repository\Exceptions\DataNotFound
\Nette\Utils\JsonException
\Iqrf\Repository\Exceptions\ServiceUnavailable

Returns

\Iqrf\Repository\Entities\Files —

Files