Skip to content

Commit

Permalink
chore: remove unused method
Browse files Browse the repository at this point in the history
Signed-off-by: Vitor Mattos <[email protected]>
  • Loading branch information
vitormattos committed Dec 30, 2024
1 parent 88dd5fa commit 58ab420
Showing 1 changed file with 9 additions and 24 deletions.
33 changes: 9 additions & 24 deletions lib/Service/SignFileService.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,6 @@ public function setLibreSignFile(FileEntity $libreSignFile): self {
return $this;
}

public function setLibreSignFileFromNode(Node $node): self {
$libreSignFile = $this->getLibresignFile($node->getId());
$this->setLibreSignFile($libreSignFile);
$this->setFileToSign($node);
return $this;
}

public function setUserUniqueIdentifier(string $identifier): self {
$this->userUniqueIdentifier = $identifier;
return $this;
Expand Down Expand Up @@ -378,31 +371,23 @@ private function getPfxFile(): string {
return $this->pkcs12Handler->getPfx();
}

private function setFileToSign(Node $file): void {
$this->fileToSign = $file;
}

/**
* Get file to sign
*
* @throws LibresignException
*/
public function getFileToSing(FileEntity $libresignFile): \OCP\Files\Node {
if ($this->fileToSign) {
$originalFile = $this->fileToSign;
} else {
$nodeId = $libresignFile->getNodeId();
$nodeId = $libresignFile->getNodeId();

$mountsContainingFile = $this->userMountCache->getMountsForFileId($nodeId);
foreach ($mountsContainingFile as $fileInfo) {
$this->root->getByIdInPath($nodeId, $fileInfo->getMountPoint());
}
$originalFile = $this->root->getById($nodeId);
if (count($originalFile) < 1) {
throw new LibresignException($this->l10n->t('File not found'));
}
$originalFile = current($originalFile);
$mountsContainingFile = $this->userMountCache->getMountsForFileId($nodeId);
foreach ($mountsContainingFile as $fileInfo) {
$this->root->getByIdInPath($nodeId, $fileInfo->getMountPoint());
}
$originalFile = $this->root->getById($nodeId);
if (count($originalFile) < 1) {
throw new LibresignException($this->l10n->t('File not found'));
}
$originalFile = current($originalFile);
if (strtolower($originalFile->getExtension()) === 'pdf') {
return $this->getPdfToSign($libresignFile, $originalFile);
}
Expand Down

0 comments on commit 58ab420

Please sign in to comment.