l10n->t('HTML Viewer'); } #[\Override] public function getMimetypes(): array { return [ 'text/html', ]; } #[\Override] public function getMimetypesOptional(): array { return []; } #[\Override] public function getCreators(): array { return []; } #[\Override] public function isSecure(): bool { return false; } #[\Override] public function open(IToken $token): Response { $token->useTokenScope(); try { $file = $token->getFile(); return new TemplateResponse( Application::APP_ID, 'directEditing', [ 'fileId' => $file->getId(), 'fileName' => $file->getName(), 'fileContent' => $file->getContent(), ], 'base' ); } catch (InvalidPathException|NotFoundException) { return new NotFoundResponse(); } } }