19 declare(strict_types=1);
    28     private readonly \ILIAS\ResourceStorage\Services 
$irss;
    29     private readonly \ILIAS\FileUpload\FileUpload 
$upload;
    37         private readonly 
int $obj_id = 0,
    38         private int $draft_id = 0
    41         $this->irss = $DIC->resourceStorage();
    42         $this->
upload = $DIC->upload();
    53         if ($use_cache && isset($this->posting_cache[$draft_id])) {
    54             return $this->posting_cache[$draft_id];
    62         return $this->collection_cache[$this->draft_id] ?? ($this->collection_cache[$this->draft_id] = $this->irss->collection(
    64             $this->irss->collection()->id(
    73             $revision = $this->irss->manage()->getCurrentRevision($identification);
    74             if ($revision->getTitle() === $hash) {
    75                 return $identification;
    89         return $this->draft_id;
    92     public function setPosId(
int $posting_id): void
    94         $this->draft_id = $posting_id;
    99         return self::FORUM_PATH_RCID;
   109             $revision = $this->irss->manage()->getCurrentRevision($identification);
   110             $info = $revision->getInformation();
   111             $files[$revision->getTitle()] = [
   112                 'path' => $this->irss->consume()->stream($identification)->getStream()->getMetadata(
'uri'),
   113                 'md5' => $revision->getTitle(),
   114                 'name' => $info->getTitle(),
   115                 'size' => $info->getSize(),
   116                 'ctime' => $info->getCreationDate()->format(
'Y-m-d H:i:s')
   129     public function ilClone(
int $new_obj_id, 
int $new_posting_id): bool
   132         $new_collection_id = $this->irss->collection()->clone($current_collection_id);
   134         $new_draft->setRCID($new_collection_id->serialize());
   135         $new_draft->update();
   140     public function delete(array $posting_ids_to_delete = null): 
bool   143         if ($posting_ids_to_delete === null) {
   147         foreach ($posting_ids_to_delete as $draft_id) {
   148             $this->irss->collection()->remove(
   149                 $this->irss->collection()->id(
   162         if (!$this->
upload->hasBeenProcessed()) {
   167         foreach ($this->
upload->getResults() as $result) {
   168             if (!$result->isOK()) {
   171             $rid = $this->irss->manage()->upload(
   174                 md5($result->getName())
   176             $collection->add($rid);
   178         $this->irss->collection()->store($collection);
   180         $draft->setRCID($collection->getIdentification()->serialize());
   188         throw new DomainException(
'Not implemented');
   197             $revision = $this->irss->manage()->getCurrentRevision($identification);
   198             if ($revision->getTitle() === $hashed_filename) {
   199                 $info = $revision->getInformation();
   202                     'filename' => $info->getTitle(),
   203                     'clean_filename' => $info->getTitle()
   216         $hashes = is_array($hashed_filename_or_filenames)
   217             ? $hashed_filename_or_filenames
   218             : [$hashed_filename_or_filenames];
   220         foreach ($hashes as $hash) {
   222             if ($identification !== null) {
   223                 $this->irss->manage()->remove($identification, $this->stakeholder);
   234             $this->irss->consume()->download($rid)->run();
   248             ->downloadCollection($rcid, $zip_filename)
   249             ->useRevisionTitlesForFileNames(
false)
 static returnASCIIFileName(string $original_filename)
Converts a UTF-8 filename to ASCII. 
 
getFileDataByMD5Filename(string $hashed_filename)
 
readonly ILIAS FileUpload FileUpload $upload
 
unlinkFile(string $filename)
 
Class ResourceCollection. 
 
__construct(private readonly int $obj_id=0, private int $draft_id=0)
 
readonly ilForumPostingFileStakeholder $stakeholder
 
deliverFile(string $file)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
getDraftById(int $draft_id, bool $use_cache=true)
 
Class ResourceIdentification. 
 
unlinkFilesByMD5Filenames($hashed_filename_or_filenames)
 
moveFilesOfPost(int $new_frm_id=0)
 
getResourceIdByHash(string $hash)
 
getCurrentDraft(bool $use_cache=true)
 
setPosId(int $posting_id)
 
ilClone(int $new_obj_id, int $new_posting_id)
 
static newInstanceByDraftId(int $draft_id)
 
readonly ILIAS ResourceStorage Services $irss