DownloadService

Extends \OCA\Gallery\Service\Service

Prepares the file to download

package

OCA\Gallery\Service

Methods

Constructor

__construct(string $appName, \OCA\Gallery\Environment\Environment $environment, \OCP\ILogger $logger) 
inherited

Arguments

$appName

string

$logger

\OCP\ILogger

Downloads the requested file

downloadFile(\OCP\Files\File $file, boolean $base64Encode = false) : array|false
Throws
\OCA\Gallery\Service\NotFoundServiceException

Arguments

$file

\OCP\Files\File

$base64Encode

boolean

Response

array|false

Returns base64 encoded data of a preview

encode(\OC_Image|string $previewData) : string
inherited

Using base64_encode for files which are downloaded (cached Thumbnails, SVG, GIFs) and using __toStrings for the previews which are instances of \OC_Image

Arguments

$previewData

\OC_Image|string

Response

string

Returns the file matching the given ID

getFile(integer $nodeId) : \OCP\Files\Node
inherited
Throws
\OCA\Gallery\Service\NotFoundServiceException

Arguments

$nodeId

integer

ID of the resource to locate

Response

\OCP\Files\Node

Returns the node matching the given ID

getNode(integer $nodeId) : \OCP\Files\Node
inherited
Throws
\OCA\Gallery\Service\NotFoundServiceException

Arguments

$nodeId

integer

ID of the resource to locate

Response

\OCP\Files\Node

Makes extra sure that we can actually do something with the file

validateNode(\OCP\Files\Node $node) 
inherited
Throws
\OCA\Gallery\Service\NotFoundServiceException

Arguments

$node

\OCP\Files\Node

Properties

appName

appName : string
inherited
var

Type(s)

string

environment

environment : \OCA\Gallery\Environment\Environment
inherited

logger

logger : \OCP\ILogger
inherited
var

Type(s)

\OCP\ILogger