ILIAS  trunk Revision v12.0_alpha-1540-g00f839d5fa1
ILIAS\WebDAV\Entity\ProblemInfoFile Class Reference

Virtual text file shown in every container that lists ILIAS objects which cannot be exposed via WebDAV (forbidden characters, duplicate titles, info-file name collisions). More...

+ Inheritance diagram for ILIAS\WebDAV\Entity\ProblemInfoFile:
+ Collaboration diagram for ILIAS\WebDAV\Entity\ProblemInfoFile:

Public Member Functions

 hasProblems ()
 
 getName ()
 
 setName ($name)
 
 getLastModified ()
 
 put ($data)
 
 get ()
 
 getSize ()
 
 getContentType ()
 
 getETag ()
 
 delete ()
 

Data Fields

const string FILE_NAME = '#!_WEBDAV_INFORMATION.txt'
 

Detailed Description

Virtual text file shown in every container that lists ILIAS objects which cannot be exposed via WebDAV (forbidden characters, duplicate titles, info-file name collisions).

Read-only; cannot be written, renamed, deleted.

Author
Fabian Schmid fabia.nosp@m.n@sr.nosp@m..solu.nosp@m.tion.nosp@m.s

Definition at line 34 of file ProblemInfoFile.php.

Member Function Documentation

◆ delete()

ILIAS\WebDAV\Entity\ProblemInfoFile::delete ( )

Definition at line 121 of file ProblemInfoFile.php.

121 : void
122 {
123 throw new Forbidden('The error info file cannot be deleted');
124 }

◆ get()

ILIAS\WebDAV\Entity\ProblemInfoFile::get ( )

Definition at line 75 of file ProblemInfoFile.php.

75 : string
76 {
77 $message = '';
78
79 if ($this->info_name_collision) {
80 $message .= '# ' . $this->lang->txt('webdav_problem_info_duplicate') . "\n\n";
81 }
82
83 if ($this->duplicate_titles !== []) {
84 $message .= '# ' . $this->lang->txt('webdav_duplicate_detected_title') . "\n";
85 foreach ($this->duplicate_titles as $title) {
86 $message .= $title . "\n";
87 }
88 $message .= "\n";
89 }
90
91 if ($this->forbidden_titles !== []) {
92 $message .= '# ' . $this->lang->txt('webdav_forbidden_chars_title') . "\n";
93 foreach ($this->forbidden_titles as $title) {
94 $message .= $title . "\n";
95 }
96 $message .= "\n";
97 }
98
99 if ($message === '') {
100 return $this->lang->txt('webdav_problem_free_container');
101 }
102
103 return $message;
104 }

◆ getContentType()

ILIAS\WebDAV\Entity\ProblemInfoFile::getContentType ( )

Definition at line 111 of file ProblemInfoFile.php.

111 : string
112 {
113 return 'text/plain';
114 }

◆ getETag()

ILIAS\WebDAV\Entity\ProblemInfoFile::getETag ( )

Definition at line 116 of file ProblemInfoFile.php.

116 : ?string
117 {
118 return null;
119 }

◆ getLastModified()

ILIAS\WebDAV\Entity\ProblemInfoFile::getLastModified ( )

Definition at line 65 of file ProblemInfoFile.php.

65 : int
66 {
67 return time();
68 }

◆ getName()

ILIAS\WebDAV\Entity\ProblemInfoFile::getName ( )

Definition at line 55 of file ProblemInfoFile.php.

55 : string
56 {
57 return self::FILE_NAME;
58 }

References ILIAS\WebDAV\Entity\ProblemInfoFile\FILE_NAME.

◆ getSize()

ILIAS\WebDAV\Entity\ProblemInfoFile::getSize ( )

Definition at line 106 of file ProblemInfoFile.php.

106 : int
107 {
108 return strlen($this->get());
109 }

◆ hasProblems()

ILIAS\WebDAV\Entity\ProblemInfoFile::hasProblems ( )

Definition at line 48 of file ProblemInfoFile.php.

48 : bool
49 {
50 return $this->info_name_collision
51 || $this->duplicate_titles !== []
52 || $this->forbidden_titles !== [];
53 }

◆ put()

ILIAS\WebDAV\Entity\ProblemInfoFile::put (   $data)

Definition at line 70 of file ProblemInfoFile.php.

70 : void
71 {
72 throw new Forbidden('The error info file is virtual and cannot be overwritten');
73 }

◆ setName()

ILIAS\WebDAV\Entity\ProblemInfoFile::setName (   $name)

Definition at line 60 of file ProblemInfoFile.php.

60 : void
61 {
62 throw new Forbidden('The error info file cannot be renamed');
63 }

Field Documentation

◆ FILE_NAME

const string ILIAS\WebDAV\Entity\ProblemInfoFile::FILE_NAME = '#!_WEBDAV_INFORMATION.txt'

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