ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\LegalDocuments\FileUpload\PreProcessor Class Reference
+ Inheritance diagram for ILIAS\LegalDocuments\FileUpload\PreProcessor:
+ Collaboration diagram for ILIAS\LegalDocuments\FileUpload\PreProcessor:

Public Member Functions

 __construct (private readonly Closure $fill)
 
 process (FileStream $stream, Metadata $metadata)
 This method gets invoked by the file upload service to process the file with the help of the processor. More...
 
 process (FileStream $stream, Metadata $metadata)
 This method gets invoked by the file upload service to process the file with the help of the processor. More...
 

Detailed Description

Definition at line 29 of file PreProcessor.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\LegalDocuments\FileUpload\PreProcessor::__construct ( private readonly Closure  $fill)
Parameters
Closure(string)void $fill

Definition at line 34 of file PreProcessor.php.

35 {
36 }

Member Function Documentation

◆ process()

ILIAS\LegalDocuments\FileUpload\PreProcessor::process ( FileStream  $stream,
Metadata  $metadata 
)

This method gets invoked by the file upload service to process the file with the help of the processor.

If the return value is REJECTED, no further invocations of processors are done for the rejected file.

If the processor fails or returns an unexpected value, the file gets automatically rejected because the file could be dangerous to ILIAS.

Parameters
FileStream$streamThe stream of the file.
Metadata$metadataThe meta data of the uploaded file.
Returns
ProcessingStatus The new status of the file.

Implements ILIAS\FileUpload\Processor\PreProcessor.

Definition at line 38 of file PreProcessor.php.

38 : ProcessingStatus
39 {
40 ($this->fill)($stream->getContents());
41
42 return new ProcessingStatus(ProcessingStatus::OK, 'idontcare');
43 }

References ILIAS\FileUpload\DTO\ProcessingStatus\OK.

Referenced by ILIAS\LegalDocuments\test\FileUpload\PreProcessorTest\testProcess().

+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: