60         $this->id_type = $gui_object->
getIdType();
    66         $zip_name = $this->storage->manage()->getCurrentRevision($rid)->getInformation()->getTitle();
    68         $base_path = $info->getBasename(
"." . $info->getExtension());
    69         $base_container = $this->
createContainerObj($base_path, $this->gui_object->getParentId());
    71         return (
int) $base_container->getRefId();
    80         $container_obj->setTitle($dir_name);
    82         $container_obj->create();
    83         $container_obj->createReference();
    85         $this->gui_object->putObjectInTree($container_obj, $parent_id);
    87         return $container_obj;
    96             throw new LogicException(
"openZip() can only be called once, yet it was called again.");
    99         $file_uri = $this->storage->consume()->stream($rid)->getStream()->getMetadata(self::IRSS_FILEPATH_KEY);
   100         $this->archive = 
new ZipArchive();
   101         $this->archive->open($file_uri);
   111             throw new LogicException(
"cannot read content of unopened zip archive");
   114         for ($i = 0, $i_max = $this->archive->count(); $i < $i_max; $i++) {
   115             $path = $this->archive->getNameIndex($i, ZipArchive::FL_UNCHANGED);
   116             if (str_contains(
$path, 
'__MACOSX')) {
   119             if (str_contains(
$path, 
'.DS_')) {
   134             if (str_ends_with($path, 
"/")) {
   137             if (str_ends_with($path, 
"\\")) {
   148             $dirname = dirname($zip_directory);
   149             if ($dirname === 
'.') {
   157             $dirname = dirname($zip_file);
   158             if ($dirname === 
'.') {
   177             if (str_ends_with($path, 
"/") || str_ends_with($path, 
"\\")) {
   178                 $directories[] = 
$path;
   183             $dir_name = dirname($path) . 
'/';
   184             if ($dir_name !== 
'./' && $dir_name !== 
'/' && !in_array($dir_name, $directories, 
true)) {
   185                 $directories[] = $dir_name;
   189         $directories_with_parents = [];
   191         foreach ($directories as $directory) {
   192             $parent = dirname($directory) . 
'/';
   193             if ($parent !== 
'./' && !in_array($parent, $directories)) {
   194                 $directories_with_parents[] = $parent;
   196             $directories_with_parents[] = $directory;
   199         $directories_with_parents = array_unique($directories_with_parents);
   200         sort($directories_with_parents);
   201         yield 
from $directories_with_parents;
   210             throw new LogicException(
"No archive has been opened yet, call openZip() first in order to read files.");
   213         return $this->storage->manage()->stream(
   214             Streams::ofString($this->archive->getFromName($file_path)),
   226             $this->archive->close();
   247         return match ($type) {
 
ilFileServicesSettings $settings
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
__construct(ResourceStakeholder $stakeholder, ilObjFileGUI $gui_object, Services $storage, ilFileServicesSettings $settings, private $tree)
 
isWorkspace()
Returns whether the current context is workspace. 
 
getZipFiles()
Yields the file-paths of the currently open zip-archive. 
 
createSurroundingContainer(ResourceIdentification $rid)
 
getZipDirectories()
Yields the directory-paths of the currently open zip-archive. 
 
Class ilObjFileAbstractZipProcessor. 
 
ResourceStakeholder $stakeholder
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
Class ResourceIdentification. 
 
storeZippedFile(string $file_path)
Creates an IRSS resource from the given filepath. 
 
hasMultipleRootEntriesInZip()
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
getPossibleContainerObj(int $parent_id)
Returns a container object that is possible for the given parent. 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
closeZip()
Closes the currently open zip-archive. 
 
getZipPaths()
Yields all paths of the currently open zip-archive (without some macos stuff). 
 
Class ilObjFileAbstractProcessorInterface. 
 
bool $create_base_container_for_multiple_root_entries
Unzip on operating systems may behave differently when unzipping if there are only one or more root n...
 
GUI class for file objects. 
 
openZip(ResourceIdentification $rid)
Opens the zip archive of the given resource. 
 
Interface ResourceStakeholder. 
 
static _lookupType(int $id, bool $reference=false)
 
createContainerObj(string $dir_name, int $parent_id)
Creates a container object depending on the parent's node type and returns it.