ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 37 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 57 of file Metadata.php.

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

58  {
59  $this->stringTypeCheck($filename, "filename");
60  $this->intTypeCheck($size, "size");
61  $this->stringTypeCheck($mimeType, "mimeType");
62 
63  $this->filename = $filename;
64  $this->uploadSize = $size;
65  $this->mimeType = $mimeType;
66  $this->additionalMetaData = new EntryLockingStringMap();
67  }
additionalMetaData()
Provides a string map implementation which allows the processors to store additional values...
Definition: Metadata.php:147
+ 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 147 of file Metadata.php.

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

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

147  : StringMap
148  {
150  }
+ 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 76 of file Metadata.php.

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

76  : string
77  {
78  return $this->filename;
79  }

◆ 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 118 of file Metadata.php.

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

Referenced by ilCountPDFPagesPreProcessors\process().

118  : string
119  {
120  return $this->mimeType;
121  }
+ 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 106 of file Metadata.php.

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

106  : int
107  {
108  return $this->uploadSize;
109  }

◆ setFilename()

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

Overwrite the current filename.

Parameters
string$filenameThe new filename.
Since
5.3

Definition at line 89 of file Metadata.php.

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

89  : self
90  {
91  $this->stringTypeCheck($filename, "filename");
92 
93  $this->filename = $filename;
94 
95  return $this;
96  }

◆ 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 131 of file Metadata.php.

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

131  : self
132  {
133  $this->stringTypeCheck($mimeType, "mimeType");
134 
135  $this->mimeType = $mimeType;
136 
137  return $this;
138  }

Field Documentation

◆ $additionalMetaData

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

Definition at line 43 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 41 of file Metadata.php.

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


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