@@ -23,7 +23,6 @@
|
|||||||
|
|
||||||
namespace OCA\Deck\Service;
|
namespace OCA\Deck\Service;
|
||||||
|
|
||||||
|
|
||||||
use OC\Security\CSP\ContentSecurityPolicyManager;
|
use OC\Security\CSP\ContentSecurityPolicyManager;
|
||||||
use OCA\Deck\Db\Attachment;
|
use OCA\Deck\Db\Attachment;
|
||||||
use OCP\AppFramework\Http\ContentSecurityPolicy;
|
use OCP\AppFramework\Http\ContentSecurityPolicy;
|
||||||
@@ -35,23 +34,26 @@ use OCP\Files\NotPermittedException;
|
|||||||
use OCP\Files\SimpleFS\ISimpleFile;
|
use OCP\Files\SimpleFS\ISimpleFile;
|
||||||
use OCP\Files\SimpleFS\ISimpleFolder;
|
use OCP\Files\SimpleFS\ISimpleFolder;
|
||||||
use OCP\IL10N;
|
use OCP\IL10N;
|
||||||
|
use OCP\ILogger;
|
||||||
use OCP\IRequest;
|
use OCP\IRequest;
|
||||||
|
|
||||||
|
|
||||||
class FileService implements IAttachmentService {
|
class FileService implements IAttachmentService {
|
||||||
|
|
||||||
private $l10n;
|
private $l10n;
|
||||||
private $appData;
|
private $appData;
|
||||||
private $request;
|
private $request;
|
||||||
|
private $logger;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
IL10N $l10n,
|
IL10N $l10n,
|
||||||
IAppData $appData,
|
IAppData $appData,
|
||||||
IRequest $request
|
IRequest $request,
|
||||||
|
ILogger $logger
|
||||||
) {
|
) {
|
||||||
$this->l10n = $l10n;
|
$this->l10n = $l10n;
|
||||||
$this->appData = $appData;
|
$this->appData = $appData;
|
||||||
$this->request = $request;
|
$this->request = $request;
|
||||||
|
$this->logger = $logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -84,9 +86,10 @@ class FileService implements IAttachmentService {
|
|||||||
try {
|
try {
|
||||||
$file = $this->getFileForAttachment($attachment);
|
$file = $this->getFileForAttachment($attachment);
|
||||||
} catch (NotFoundException $e) {
|
} catch (NotFoundException $e) {
|
||||||
// TODO: log error
|
$this->logger->info('Extending data for file attachment failed');
|
||||||
return $attachment;
|
return $attachment;
|
||||||
} catch (NotPermittedException $e) {
|
} catch (NotPermittedException $e) {
|
||||||
|
$this->logger->info('Extending data for file attachment failed');
|
||||||
return $attachment;
|
return $attachment;
|
||||||
}
|
}
|
||||||
$attachment->setExtendedData([
|
$attachment->setExtendedData([
|
||||||
|
|||||||
Reference in New Issue
Block a user