ILIAS  release_8 Revision v8.23
ILIAS\FileUpload\DTO\Metadata Class Reference

Class Metadata. More...

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

Public Member Functions

 __construct (string $filename, int $size, string $mimeType)
 Metadata constructor. More...
 
 getFilename ()
 The filename supplied by the browser. More...
 
 setFilename (string $filename)
 Overwrite the current filename. More...
 
 getUploadSize ()
 This is always the original file size which was determined by the http service. More...
 
 getMimeType ()
 Client supplied mime type of the uploaded. More...
 
 setMimeType (string $mimeType)
 Overwrite the current mime type of the file. More...
 
 additionalMetaData ()
 Provides a string map implementation which allows the processors to store additional values. More...
 

Private Attributes

string $filename
 
int $uploadSize
 
string $mimeType
 
StringMap $additionalMetaData
 

Detailed Description

Class Metadata.

The meta data class holds all the data which are passed to each processor. 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 21 of file Metadata.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\FileUpload\DTO\Metadata::__construct ( string  $filename,
int  $size,
string  $mimeType 
)

Metadata constructor.

Parameters
string$filenameThe filename of the uploaded file.
int$sizeThe original size of the uploaded file.
string$mimeTypeThe mime type of the uploaded file.
Exceptions

Definition at line 41 of file Metadata.php.

References ILIAS\FileUpload\DTO\Metadata\$filename, ILIAS\FileUpload\DTO\Metadata\$mimeType, and ILIAS\FileUpload\DTO\Metadata\additionalMetaData().

42  {
43  $this->stringTypeCheck($filename, "filename");
44  $this->intTypeCheck($size, "size");
45  $this->stringTypeCheck($mimeType, "mimeType");
46 
47  $this->filename = $filename;
48  $this->uploadSize = $size;
49  $this->mimeType = $mimeType;
50  $this->additionalMetaData = new EntryLockingStringMap();
51  }
additionalMetaData()
Provides a string map implementation which allows the processors to store additional values...
Definition: Metadata.php:131
+ Here is the call graph for this function:

Member Function Documentation

◆ additionalMetaData()

ILIAS\FileUpload\DTO\Metadata::additionalMetaData ( )

Provides a string map implementation which allows the processors to store additional values.

The string map implementation used by the meta data refuses to overwrite values.

Since
5.3

Definition at line 131 of file Metadata.php.

References ILIAS\FileUpload\DTO\Metadata\$additionalMetaData.

Referenced by ILIAS\FileUpload\DTO\Metadata\__construct(), and ilCountPDFPagesPreProcessors\process().

131  : StringMap
132  {
134  }
+ Here is the caller graph for this function:

◆ getFilename()

ILIAS\FileUpload\DTO\Metadata::getFilename ( )

The filename supplied by the browser.

Please be aware of the fact that this value can be potentially unsafe.

Since
5.3

Definition at line 60 of file Metadata.php.

References ILIAS\FileUpload\DTO\Metadata\$filename.

Referenced by ILIAS\FileUpload\Processor\FilenameSanitizerPreProcessor\process(), ILIAS\FileUpload\Processor\AbstractRecursiveZipPreProcessor\process(), ILIAS\FileUpload\Processor\WhitelistExtensionPreProcessor\process(), and ILIAS\FileUpload\FileUploadImpl\rejectFailedUpload().

60  : string
61  {
62  return $this->filename;
63  }
+ Here is the caller graph for this function:

◆ getMimeType()

ILIAS\FileUpload\DTO\Metadata::getMimeType ( )

Client supplied mime type of the uploaded.

This value must be threaded as unreliable.

Since
5.3

Definition at line 102 of file Metadata.php.

References ILIAS\FileUpload\DTO\Metadata\$mimeType.

Referenced by ilCountPDFPagesPreProcessors\process(), ILIAS\FileUpload\Processor\BlacklistMimeTypePreProcessor\process(), ILIAS\FileUpload\Processor\WhitelistMimeTypePreProcessor\process(), and ILIAS\FileUpload\FileUploadImpl\rejectFailedUpload().

102  : string
103  {
104  return $this->mimeType;
105  }
+ Here is the caller graph for this function:

◆ getUploadSize()

ILIAS\FileUpload\DTO\Metadata::getUploadSize ( )

This is always the original file size which was determined by the http service.

The current size is provided by the size method of the Stream passed to the processor. Please use the filesystem service to get the file size outside of the processors.

Since
5.3

Definition at line 90 of file Metadata.php.

References ILIAS\FileUpload\DTO\Metadata\$uploadSize.

Referenced by ILIAS\FileUpload\FileUploadImpl\rejectFailedUpload().

90  : int
91  {
92  return $this->uploadSize;
93  }
+ Here is the caller graph for this function:

◆ setFilename()

ILIAS\FileUpload\DTO\Metadata::setFilename ( string  $filename)

Overwrite the current filename.

Parameters
string$filenameThe new filename.
Since
5.3

Definition at line 73 of file Metadata.php.

References ILIAS\FileUpload\DTO\Metadata\$filename.

Referenced by ILIAS\FileUpload\Processor\FilenameSanitizerPreProcessor\process().

73  : self
74  {
75  $this->stringTypeCheck($filename, "filename");
76 
77  $this->filename = $filename;
78 
79  return $this;
80  }
+ Here is the caller graph for this function:

◆ setMimeType()

ILIAS\FileUpload\DTO\Metadata::setMimeType ( string  $mimeType)

Overwrite the current mime type of the file.

Parameters
string$mimeTypeThe new mime type if the file.
Since
5.3

Definition at line 115 of file Metadata.php.

References ILIAS\FileUpload\DTO\Metadata\$mimeType.

115  : self
116  {
117  $this->stringTypeCheck($mimeType, "mimeType");
118 
119  $this->mimeType = $mimeType;
120 
121  return $this;
122  }

Field Documentation

◆ $additionalMetaData

StringMap ILIAS\FileUpload\DTO\Metadata::$additionalMetaData
private

Definition at line 27 of file Metadata.php.

Referenced by ILIAS\FileUpload\DTO\Metadata\additionalMetaData().

◆ $filename

string ILIAS\FileUpload\DTO\Metadata::$filename
private

◆ $mimeType

string ILIAS\FileUpload\DTO\Metadata::$mimeType
private

◆ $uploadSize

int ILIAS\FileUpload\DTO\Metadata::$uploadSize
private

Definition at line 25 of file Metadata.php.

Referenced by ILIAS\FileUpload\DTO\Metadata\getUploadSize().


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