timeFactory = $timeFactory; } /** * @return string */ public function getName() { return self::FILENAME; } public function setName($name) { throw new Forbidden('Renaming ' . self::FILENAME . ' is forbidden'); } /** * @return null */ public function getLastModified() { return null; } /** * @throws Forbidden */ public function delete() { throw new Forbidden(self::FILENAME . ' may not be deleted.'); } /** * @param array $properties * @return array */ public function getProperties($properties) { $datetime = $this->timeFactory->getDateTime(); return [ '{DAV:}getcontentlength' => 42, '{DAV:}getlastmodified' => $datetime->format(\DateTimeInterface::RFC2822), ]; } /** * @param PropPatch $propPatch * @throws Forbidden */ public function propPatch(PropPatch $propPatch) { throw new Forbidden(self::FILENAME . '\'s properties may not be altered.'); } }