ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ILIAS\FileUpload\DTO\ProcessingStatus Class Reference

Class ProcessingStatus. More...

+ Collaboration diagram for ILIAS\FileUpload\DTO\ProcessingStatus:

Public Member Functions

 __construct ($code, $reason)
 ProcessingStatus constructor. More...
 
 getCode ()
 
 getMessage ()
 

Data Fields

const OK = 1
 Upload is ok. More...
 
const REJECTED = 2
 Upload got rejected by a processor. More...
 

Private Attributes

 $code
 
 $message
 

Detailed Description

Class ProcessingStatus.

The class is used by the processors to give feedback to the UploadService about the validity of the current processed file. This class only purpose is to transport data.

Author
Nicolas Schäfli ns@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch
Since
5.3
Version
1.0

Definition at line 20 of file ProcessingStatus.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\FileUpload\DTO\ProcessingStatus::__construct (   $code,
  $reason 
)

ProcessingStatus constructor.

Parameters
int$codeThe code OK or REJECTED.
string$reasonThe message which should be set to make the rejection more understandable for other developers.
Exceptions

Definition at line 53 of file ProcessingStatus.php.

References ILIAS\FileUpload\DTO\ProcessingStatus\$code.

54  {
55  $this->intTypeCheck($code, 'code');
56  $this->stringTypeCheck($reason, 'reason');
57 
58  if ($code !== self::OK && $code !== self::REJECTED) {
59  throw new \InvalidArgumentException('Invalid upload status code received. The code must be OK or REJECTED.');
60  }
61 
62  $this->code = $code;
63  $this->message = $reason;
64  }

Member Function Documentation

◆ getCode()

ILIAS\FileUpload\DTO\ProcessingStatus::getCode ( )
Returns
int
Since
5.3

Definition at line 71 of file ProcessingStatus.php.

References ILIAS\FileUpload\DTO\ProcessingStatus\$code.

◆ getMessage()

ILIAS\FileUpload\DTO\ProcessingStatus::getMessage ( )
Returns
string
Since
5.3

Definition at line 81 of file ProcessingStatus.php.

References ILIAS\FileUpload\DTO\ProcessingStatus\$message.

Field Documentation

◆ $code

int ILIAS\FileUpload\DTO\ProcessingStatus::$code
private

◆ $message

string ILIAS\FileUpload\DTO\ProcessingStatus::$message
private

◆ OK

const ILIAS\FileUpload\DTO\ProcessingStatus::OK = 1

Upload is ok.

Definition at line 26 of file ProcessingStatus.php.

Referenced by ilChatroomAdminSmileyGUI\confirmedDeleteMultipleObject(), ilObjectTileImage\delete(), ilChatroomAdminSmileyGUI\deleteSmileyObject(), ilCertificateGUI\getEditorForm(), ilObjBibliographic\getFileDirectory(), ILIAS\FileUpload\Processor\FilenameSanitizerPreProcessor\process(), ILIAS\FileUpload\Processor\PreProcessorManagerImpl\process(), ILIAS\FileUpload\Processor\VirusScannerPreProcessor\process(), ILIAS\FileUpload\Processor\WhitelistFileHeaderPreProcessor\process(), ILIAS\FileUpload\Processor\BlacklistFileHeaderPreProcessor\process(), ILIAS\FileUpload\Processor\BlacklistMimeTypePreProcessor\process(), ILIAS\FileUpload\Processor\WhitelistMimeTypePreProcessor\process(), ILIAS\FileUpload\Processor\WhitelistExtensionPreProcessor\process(), ILIAS\FileUpload\Processor\BlacklistExtensionPreProcessor\process(), ilObjFile\raiseUploadError(), ilObjectCustomIconImpl\saveFromSourceFile(), ilOpenIdConnectSettingsGUI\saveImageFromHttpRequest(), ilWorkflowEngineDefinitionsGUI\showUploadForm(), ILIAS\FileUpload\Processor\VirusScannerPreProcessorTest\testNoVirusDetected(), ILIAS\FileUpload\Processor\PreProcessorManagerImplTest\testProcessInvalidFileWhichShouldGetRejected(), ILIAS\FileUpload\Processor\PreProcessorManagerImplTest\testProcessValidFileWhichShouldSucceed(), ILIAS\FileUpload\Processor\PreProcessorManagerImplTest\testProcessValidFileWithFailingProcessorWhichShouldGetRejected(), ILIAS\FileUpload\Processor\BlacklistFileHeaderPreProcessorTest\testProcessWhichShouldSucceed(), ILIAS\FileUpload\Processor\FilenameOverridePreProcessorTest\testProcessWhichShouldSucceed(), ILIAS\FileUpload\Processor\WhitelistFileHeaderPreProcessorTest\testProcessWhichShouldSucceed(), ILIAS\FileUpload\Processor\BlacklistExtensionPreProcessorTest\testProcessWhichShouldSucceed(), ILIAS\FileUpload\Processor\WhitelistExtensionPreProcessorTest\testProcessWhichShouldSucceed(), ILIAS\FileUpload\FileUploadImplTest\testProcessWhichShouldSucceed(), ILIAS\FileUpload\Processor\WhitelistExtensionPreProcessorTest\testProcessWithoutExtensionWhichShouldSucceed(), ILIAS\FileUpload\Processor\PreProcessorManagerImplTest\testProcessWithoutProcessorsWhichShouldSucceed(), ILIAS\FileUpload\Processor\WhitelistMimeTypePreProcessorTest\testProcessWithWhitelistedAnyKindOfOggMimeTypeWhichShouldSucceed(), ILIAS\FileUpload\Processor\WhitelistMimeTypePreProcessorTest\testProcessWithWhitelistedAnyKindOfTextMimeTypeWhichShouldSucceed(), and ILIAS\FileUpload\Processor\WhitelistMimeTypePreProcessorTest\testProcessWithWhitelistedMimeTypeWhichShouldSucceed().

◆ REJECTED

const ILIAS\FileUpload\DTO\ProcessingStatus::REJECTED = 2

Upload got rejected by a processor.

Definition at line 30 of file ProcessingStatus.php.

Referenced by ILIAS\FileUpload\FileUploadImpl\moveFilesTo(), ILIAS\FileUpload\FileUploadImpl\moveOneFileTo(), ILIAS\FileUpload\Processor\PreProcessorManagerImpl\process(), ILIAS\FileUpload\Processor\VirusScannerPreProcessor\process(), ILIAS\FileUpload\Processor\WhitelistFileHeaderPreProcessor\process(), ILIAS\FileUpload\Processor\BlacklistFileHeaderPreProcessor\process(), ILIAS\FileUpload\Processor\BlacklistMimeTypePreProcessor\process(), ILIAS\FileUpload\Processor\WhitelistMimeTypePreProcessor\process(), ILIAS\FileUpload\Processor\WhitelistExtensionPreProcessor\process(), ILIAS\FileUpload\Processor\BlacklistExtensionPreProcessor\process(), ILIAS\FileUpload\FileUploadImpl\regenerateUploadResultWithCopyError(), ILIAS\FileUpload\FileUploadImpl\rejectFailedUpload(), ILIAS\FileUpload\Processor\PreProcessorManagerImplTest\testProcessInvalidFileWhichShouldGetRejected(), ILIAS\FileUpload\Processor\PreProcessorManagerImplTest\testProcessValidFileWithFailingProcessorWhichShouldGetRejected(), ILIAS\FileUpload\Processor\BlacklistMimeTypePreProcessorTest\testProcessWithBlacklistedAnyKindOfOggMimeTypeWhichGetRejected(), ILIAS\FileUpload\Processor\BlacklistMimeTypePreProcessorTest\testProcessWithBlacklistedAnyKindOfTextMimeTypeWhichGetRejected(), ILIAS\FileUpload\Processor\BlacklistExtensionPreProcessorTest\testProcessWithBlacklistedEmptyExtensionWhichShouldGetRejected(), ILIAS\FileUpload\Processor\BlacklistExtensionPreProcessorTest\testProcessWithBlacklistedExtensionWhichShouldGetRejected(), ILIAS\FileUpload\Processor\BlacklistMimeTypePreProcessorTest\testProcessWithBlacklistedMimeTypeWhichShouldGetRejected(), ILIAS\FileUpload\FileUploadImplTest\testProcessWithFailedUploadWhichShouldGetRejected(), ILIAS\FileUpload\Processor\WhitelistFileHeaderPreProcessorTest\testProcessWithHeaderMismatchWhichShouldGetRejected(), ILIAS\FileUpload\Processor\BlacklistFileHeaderPreProcessorTest\testProcessWithHeaderMismatchWhichShouldGetRejected(), ILIAS\FileUpload\Processor\WhitelistExtensionPreProcessorTest\testProcessWithoutWhitelistedExtensionWhichShouldGetRejected(), ILIAS\FileUpload\Processor\VirusScannerPreProcessorTest\testVirusDetected(), and ilCertificateBackgroundImageUpload\uploadBackgroundImage().


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